' LanguageGUI - (C) John White, 2001-2002. All Rights Reserved.
' Written with William Yu`s Rapid-Q Basic Interpreter/Compiler.

$INCLUDE "RAPIDQ.INC"
$OPTIMIZE ON
$APPTYPE GUI
$TYPECHECK ON
$ESCAPECHARS ON

Application.Title="LanguageGUI  V2.09"

CONST rqClassName="TForm"
CONST myFormName="LanguageGUI"
CONST DRIVE_NOTDETERMINED=0
CONST DRIVE_NOROOTDIR=1
CONST DRIVE_REMOVABLE=2
CONST DRIVE_FIXED=3
CONST DRIVE_REMOTE=4
CONST DRIVE_CDROM=5
CONST DRIVE_RAMDISK=6

DECLARE FUNCTION FindWindow LIB "USER32.DLL" ALIAS "FindWindowA" (className AS STRING, windowName AS STRING) AS INTEGER
DECLARE FUNCTION ShowWindow LIB "USER32.DLL" ALIAS "ShowWindow" (hwnd AS LONG, command AS LONG) AS LONG
DECLARE FUNCTION GetDriveType LIB "KERNEL32.DLL" ALIAS "GetDriveTypeA" (ByVal nDrive AS STRING) AS LONG

DECLARE SUB Blank_Window ()

DEFINT hWnd=FindWindow(rqClassName, myFormName)

IF hWnd THEN
ShowMessage (Application.Title+"  is already running!")
END
END IF

DIM Canvas1 AS QCANVAS, Canvas2 AS QCANVAS, Canvas3 AS QCANVAS, Canvas4 AS QCANVAS, Canvas5 AS QCANVAS
DIM Window1 AS QForm, Window2 AS QFORM, Window3 AS QFORM, Window4 AS QFORM, Window5 AS QFORM
DIM Label1 AS QLABEL, Label2 AS QLABEL, Label3 AS QLABEL, Label4 AS QLABEL
DIM Label5 AS QLABEL, Label6 AS QLABEL, Label7 AS QLABEL, Label8 AS QLABEL
DIM Label9 AS QLABEL, Label10 AS QLABEL, Label11 AS QLABEL, Label12 AS QLABEL
DIM Label13 AS QLABEL, Label14 AS QLABEL, Label15 AS QLABEL, Label16 AS QLABEL
DIM Label17 AS QLABEL, Label18 AS QLABEL, Label19 AS QLABEL, Label20 AS QLABEL
DIM Label21 AS QLABEL, Label22 AS QLABEL, Label23 AS QLABEL, Label24 AS QLABEL
DIM AutoTimer AS QTIMER
DIM Font1 AS QFONT, Font2 AS QFONT, Font3 AS QFONT, Font4 AS QFONT
DIM Font5 AS QFONT, Font6 AS QFONT, Font7 AS QFONT, Font8 AS QFONT
DIM Font9 AS QFONT, Font10 AS QFONT, Font11 AS QFONT, Font12 AS QFONT
DIM Edit1 AS QEDIT, Edit2 AS QEDIT, Edit3 AS QEDIT, Edit4 AS QEDIT
DIM Edit5 AS QEDIT, Edit6 AS QEDIT, Edit7 AS QEDIT, Edit8 AS QEDIT
DIM WCats(22) AS QLABEL, DTitles(44) AS STRING, FTitles(44) AS STRING
DIM FNFN$(1500) AS STRING, FSFN$(1500) AS STRING

DIM YY AS INTEGER, Z AS INTEGER, COUNT AS INTEGER, POSPTR AS LONG
DIM DS AS BYTE, FS AS BYTE, DP AS BYTE, FP AS BYTE, DJ AS BYTE
DIM FJ AS BYTE, DV AS BYTE, FV AS BYTE, MN AS BYTE, SO AS BYTE
DIM PO AS BYTE, OLDCP AS BYTE, CURCP AS BYTE, CPVAL AS BYTE, PST AS BYTE
DIM OLDDT AS BYTE, CURDT AS BYTE, SPLIT AS BYTE, SPELL AS BYTE
DIM SPEECH AS BYTE, MISC AS BYTE, SEQRND AS BYTE, OLDDF AS BYTE
DIM CURDF AS BYTE, OLDPAA AS BYTE, CURPAA AS BYTE, OLDSEQ AS LONG
DIM CURSEQ AS LONG, NEXTSEQ AS LONG, DFDELAY AS BYTE, AMDELAY AS BYTE
DIM SPDELAY AS BYTE, WSDELAY AS BYTE, RVDELAY AS BYTE, STOPDELAY AS BYTE
DIM NAVDELAY AS BYTE, NX AS BYTE, FWD AS BYTE, LRN AS BYTE, AMT AS BYTE
DIM MISCSTART AS LONG, MISCEND AS LONG, LANG AS BYTE, MISCTOT AS LONG
DIM MISCLEN AS LONG, SRCHSTS AS BYTE, SRCHPOS AS LONG, STG1$ AS STRING
DIM STG2$ AS STRING, STG3$ AS STRING, STG4$ AS STRING, EDITSTG$ AS STRING
DIM SRCHCNT AS LONG, FNNUM AS WORD, FSNUM AS WORD
DIM DWAV AS BYTE, FWAV AS BYTE, DSFILE AS BYTE, FSFILE AS BYTE

DIM File AS QFILESTREAM, FStg$ AS STRING, FLen AS INTEGER, FPos AS INTEGER
DIM FByte AS BYTE, FWord AS WORD, FLong AS LONG
DIM DName$(14) AS STRING, FName$(20) AS STRING
DIM DSpeech_Dir$ AS STRING, FSpeech_Dir$ AS STRING

DIM DS1Mem AS QMEMORYSTREAM, DS2Mem AS QMEMORYSTREAM, FS1Mem AS QMEMORYSTREAM
DIM FS2Mem AS QMEMORYSTREAM, DPMem AS QMEMORYSTREAM, FPMem AS QMEMORYSTREAM
DIM DJMem AS QMEMORYSTREAM, FJMem AS QMEMORYSTREAM, DVMem AS QMEMORYSTREAM
DIM FVMem AS QMEMORYSTREAM, SettingsMem AS QMEMORYSTREAM

DIM ALen(176) AS WORD, BLen(176) AS WORD, CLen(176) AS WORD, Totals(22) AS WORD
DIM FNAss(1500) AS BYTE, FSAss(1500) AS BYTE, FNSyl(37500) AS WORD, FSSyl(37500) AS WORD

DIM NumDrives AS BYTE, drv_cnt AS BYTE
DIM Root_Dir$ AS STRING, drive$(26) AS STRING

FOR Z=0 TO 21 : Totals(Z)=0 : NEXT
FOR Z=0 TO 1499 : FNAss(Z)=0 : FSAss(Z)=0 : NEXT

DS=1 : FS=0 : DP=1 : FP=0 : DJ=1 : FJ=0 : DV=1 : FV=0 : PO=0 : SO=0
MN=0 : NX=0 : FWD=0 : OLDCP=0 : CURCP=0 : CPVAL=0 : OLDDT=10 : CURDT=0
SPLIT=0 : SPELL=0 : SPEECH=1 : MISC=0 : SEQRND=0 : OLDDF=2 : CURDF=0
OLDPAA=10 : CURPAA=0 : OLDSEQ=0 : CURSEQ=0 : NEXTSEQ=0 : DFDELAY=0
AMDELAY=0 : SPDELAY=0 : WSDELAY=0 : RVDELAY=0 : STOPDELAY=0 : NAVDELAY=0
LRN=0 : PST=0 : AMT=0 : LANG=1 : SRCHSTS=0 : FNNUM=0 : FSNUM=0
Drv_Cnt=0 : DWAV=1 : FWAV=10 : DSFILE=1 : FSFILE=10

SUB Blank_Window
ShowWindow (Application.Handle, 0)
END SUB

SUB CleanUP
DS1Mem.Close : FS1Mem.Close : DS2Mem.Close : FS2Mem.Close : DPMem.Close
FPMem.Close : DJMem.Close : FJMem.Close : DVMem.Close : FVMem.Close
END SUB

SUB Get_Drives
NumDrives=0
FOR z=0 TO 25
drive$(z)=""
FStg$=Chr$(z+65)+":\\"
FByte=GetDriveType(FStg$)
IF FByte>2 THEN
IF FByte=DRIVE_FIXED THEN
drive$(NumDrives)=FStg$+"LanguageGUI\\"
INC NumDrives
ELSEIF FByte=DRIVE_CDROM THEN
drive$(NumDrives)=FStg$+"LanguageGUI\\"
INC NumDrives
END IF
END IF
NEXT
IF NumDrives>25 THEN
drive$(25)="NO DRIVE"
ELSE
drive$(NumDrives)="NO DRIVE"
END IF
END SUB

SUB Speak_ToMe
FStg$=Root_Dir$+FSpeech_Dir$
IF SPEECH=1 THEN
IF CURSEQ<>OLDSEQ THEN
IF LRN=0 THEN
IF (DP=1 OR FP=1 OR DJ=1 OR FJ=1 OR DV=1 OR FV=1) THEN
IF OLDSEQ=BLen(CURCP+44) AND CURSEQ=ALen(CURCP+44) THEN
IF FNAss(OLDSEQ+1)=1 THEN
COUNT=0 : YY=(OLDSEQ+1)*25 : DO : FWord=FNSyl(YY+COUNT)
IF (FWord>0 AND FWord<(FNNUM+1)) THEN
PLAYWAV FStg$+FNFN$(FWord)+".wav", 0 : INC COUNT
ELSE
COUNT=25
END IF
LOOP UNTIL (COUNT=25)
END IF
ELSE
IF FNAss(CURSEQ)=1 THEN
COUNT=0 : YY=CURSEQ*25 : DO : FWord=FNSyl(YY+COUNT)
IF (FWord>0 AND FWord<(FNNUM+1)) THEN
PLAYWAV FStg$+FNFN$(FWord)+".wav", 0 : INC COUNT
ELSE
COUNT=25
END IF
LOOP UNTIL (COUNT=25)
END IF
END IF
END IF
ELSE
'IF (CURSEQ>0 AND CURSEQ<20) THEN
IF (DS=1 OR FS=1) THEN
IF OLDSEQ=BLen(CURCP) AND CURSEQ=ALen(CURCP) THEN
IF FSAss(OLDSEQ+1)=1 THEN
COUNT=0 : YY=(OLDSEQ+1)*25 : DO : FWord=FSSyl(YY+COUNT)
IF (FWord>0 AND FWord<(FSNUM+1)) THEN
PLAYWAV FStg$+FSFN$(FWord)+".wav", 0 : INC COUNT
ELSE
COUNT=25
END IF
LOOP UNTIL (COUNT=25)
END IF
ELSE
IF FSAss(CURSEQ)=1 THEN
COUNT=0 : YY=CURSEQ*25 : DO : FWord=FSSyl(YY+COUNT)
IF (FWord>0 AND FWord<(FSNUM+1)) THEN
PLAYWAV FStg$+FSFN$(FWord)+".wav", 0 : INC COUNT
ELSE
COUNT=25
END IF
LOOP UNTIL (COUNT=25)
END IF
END IF
END IF
'END IF
END IF
END IF
END IF
END SUB

SUB Show_WSearch(Number AS BYTE)
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
IF Number=0 THEN
Canvas4.TextOut (218, 172, STG1$, &HFFFFFF, -1)
Canvas4.TextOut (218, 202, STG2$, &H284C60, -1)
ELSE
Canvas4.TextOut (218, 172, STG1$, &H284C60, -1)
Canvas4.TextOut (218, 202, STG2$, &HFFFFFF, -1)
END IF
END SUB

SUB Show_SSearch(Number AS BYTE)
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
IF Number=0 THEN
Canvas4.TextOut (218, 172, STG1$, &HFFFFFF, -1)
Canvas4.TextOut (218, 200, STG2$, &HFFFFFF, -1)
Canvas4.TextOut (218, 228, STG3$, &H284C60, -1)
Canvas4.TextOut (218, 256, STG4$, &H284C60, -1)
ELSE
Canvas4.TextOut (218, 172, STG1$, &H284C60, -1)
Canvas4.TextOut (218, 200, STG2$, &H284C60, -1)
Canvas4.TextOut (218, 228, STG3$, &HFFFFFF, -1)
Canvas4.TextOut (218, 256, STG4$, &HFFFFFF, -1)
END IF
END SUB

SUB Search_DS
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP)*42))
DS1Mem.Position=SRCHPOS : STG1$=DS1Mem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF (FLong=0 AND SRCHPOS>(BLen(CURCP)*42)) THEN
SRCHPOS=ALen(CURCP)*42
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP)*42))
DS2Mem.Position=SRCHPOS : STG2$=DS2Mem.ReadStr(42)
FLong=INSTR(STG2$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
SRCHSTS=1 : DS1Mem.Position=SRCHPOS-42 : STG1$=DS1Mem.ReadStr(42)
FS1Mem.Position=SRCHPOS-42 : STG3$=FS1Mem.ReadStr(42)
FS2Mem.Position=SRCHPOS-42 : STG4$=FS2Mem.ReadStr(42) : Show_SSearch(0)
ELSE
Label16.Caption="String Not Found"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
ELSE
IF FLong>0 THEN
SRCHSTS=1 : DS2Mem.Position=SRCHPOS-42 : STG2$=DS2Mem.ReadStr(42)
FS1Mem.Position=SRCHPOS-42 : STG3$=FS1Mem.ReadStr(42)
FS2Mem.Position=SRCHPOS-42 : STG4$=FS2Mem.ReadStr(42) : Show_SSearch(0)
END IF
END IF
END SUB

SUB Search_DP
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
DPMem.Position=SRCHPOS : STG1$=DPMem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
SRCHSTS=1 : FPMem.Position=SRCHPOS-42 : STG2$=FPMem.ReadStr(42) : Show_WSearch(0)
ELSE
Label16.Caption="String Not Found"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
END SUB

SUB Search_DJ
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
DJMem.Position=SRCHPOS : STG1$=DJMem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
SRCHSTS=1 : FJMem.Position=SRCHPOS-42 : STG2$=FJMem.ReadStr(42) : Show_WSearch(0)
ELSE
Label16.Caption="String Not Found"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
END SUB

SUB Search_DV
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
DVMem.Position=SRCHPOS : STG1$=DVMem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
SRCHSTS=1 : FVMem.Position=SRCHPOS-42 : STG2$=FVMem.ReadStr(42) : Show_WSearch(0)
ELSE
Label16.Caption="String Not Found"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
END SUB

SUB Search_FS
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP)*42))
FS1Mem.Position=SRCHPOS : STG1$=FS1Mem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF (FLong=0 AND SRCHPOS>(BLen(CURCP)*42)) THEN
SRCHPOS=ALen(CURCP)*42
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP)*42))
FS2Mem.Position=SRCHPOS : STG2$=FS2Mem.ReadStr(42)
FLong=INSTR(STG2$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
SRCHSTS=1 : FS1Mem.Position=SRCHPOS-42 : STG1$=FS1Mem.ReadStr(42)
DS1Mem.Position=SRCHPOS-42 : STG3$=DS1Mem.ReadStr(42)
DS2Mem.Position=SRCHPOS-42 : STG4$=DS2Mem.ReadStr(42) : Show_SSearch(1)
ELSE
Label16.Caption="String Not Found"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
ELSE
IF FLong>0 THEN
SRCHSTS=1 : FS2Mem.Position=SRCHPOS-42 : STG2$=FS2Mem.ReadStr(42)
DS1Mem.Position=SRCHPOS-42 : STG3$=DS1Mem.ReadStr(42)
DS2Mem.Position=SRCHPOS-42 : STG4$=DS2Mem.ReadStr(42) : Show_SSearch(1)
END IF
END IF
END SUB

SUB Search_FP
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
FPMem.Position=SRCHPOS : STG1$=FPMem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
SRCHSTS=1 : DPMem.Position=SRCHPOS-42 : STG2$=DPMem.ReadStr(42) : Show_WSearch(1)
ELSE
Label16.Caption="String Not Found"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
END SUB

SUB Search_FJ
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
FJMem.Position=SRCHPOS : STG1$=FJMem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
SRCHSTS=1 : DJMem.Position=SRCHPOS-42 : STG2$=DJMem.ReadStr(42) : Show_WSearch(1)
ELSE
Label16.Caption="String Not Found"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
END SUB

SUB Search_FV
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
FVMem.Position=SRCHPOS : STG1$=FVMem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
SRCHSTS=1 : DVMem.Position=SRCHPOS-42 : STG2$=DVMem.ReadStr(42) : Show_WSearch(1)
ELSE
Label16.Caption="String Not Found"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
END SUB

SUB Search_WS
EDITSTG$=Edit8.Text : FLong=0 : SRCHSTS=0 : Label16.Caption="                   "
SRCHPOS=ALen(CURCP+44)*42
IF EDITSTG$<>"" THEN
IF CURDF=0 THEN
IF CURPAA=0 THEN
SRCHPOS=ALen(CURCP)*42 : Search_DS
ELSEIF CURPAA=1 THEN
Search_DP
ELSEIF CURPAA=2 THEN
Search_DJ
ELSEIF CURPAA=3 THEN
Search_DV
END IF
ELSE
IF CURPAA=0 THEN
SRCHPOS=ALen(CURCP)*42 : Search_FS
ELSEIF CURPAA=1 THEN
Search_FP
ELSEIF CURPAA=2 THEN
Search_FJ
ELSEIF CURPAA=3 THEN
Search_FV
END IF
END IF
END IF
END SUB

SUB Continue_DS
SRCHCNT=SRCHPOS
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP)*42))
DS1Mem.Position=SRCHPOS : STG1$=DS1Mem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF (FLong=0 AND SRCHPOS>(BLen(CURCP)*42)) THEN
SRCHPOS=SRCHCNT
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP)*42))
DS2Mem.Position=SRCHPOS : STG2$=DS2Mem.ReadStr(42)
FLong=INSTR(STG2$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
DS1Mem.Position=SRCHPOS-42 : STG1$=DS1Mem.ReadStr(42)
FS1Mem.Position=SRCHPOS-42 : STG3$=FS1Mem.ReadStr(42)
FS2Mem.Position=SRCHPOS-42 : STG4$=FS2Mem.ReadStr(42) : Show_SSearch(0)
ELSE
SRCHSTS=2 : Label16.Caption="End of Search"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
ELSE
IF FLong>0 THEN
DS2Mem.Position=SRCHPOS-42 : STG2$=DS2Mem.ReadStr(42)
FS1Mem.Position=SRCHPOS-42 : STG3$=FS1Mem.ReadStr(42)
FS2Mem.Position=SRCHPOS-42 : STG4$=FS2Mem.ReadStr(42) : Show_SSearch(0)
END IF
END IF
END SUB

SUB Continue_DP
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
DPMem.Position=SRCHPOS : STG1$=DPMem.ReadStr(42) : FLong=INSTR(STG1$, EDITSTG$)
INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
FPMem.Position=SRCHPOS-42 : STG2$=FPMem.ReadStr(42) : Show_WSearch(0)
ELSE
SRCHSTS=2 : Label16.Caption="End of Search"
END IF
END SUB

SUB Continue_DJ
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
DJMem.Position=SRCHPOS : STG1$=DJMem.ReadStr(42) : FLong=INSTR(STG1$, EDITSTG$)
INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
FJMem.Position=SRCHPOS-42 : STG2$=FJMem.ReadStr(42) : Show_WSearch(0)
ELSE
SRCHSTS=2 : Label16.Caption="End of Search"
END IF
END SUB

SUB Continue_DV
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
DVMem.Position=SRCHPOS : STG1$=DVMem.ReadStr(42) : FLong=INSTR(STG1$, EDITSTG$)
INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
FVMem.Position=SRCHPOS-42 : STG2$=FVMem.ReadStr(42) : Show_WSearch(0)
ELSE
SRCHSTS=2 : Label16.Caption="End of Search"
END IF
END SUB

SUB Continue_FS
SRCHCNT=SRCHPOS
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP)*42))
FS1Mem.Position=SRCHPOS : STG1$=FS1Mem.ReadStr(42)
FLong=INSTR(STG1$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF (FLong=0 AND SRCHPOS>(BLen(CURCP)*42)) THEN
SRCHPOS=SRCHCNT
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP)*42))
FS2Mem.Position=SRCHPOS : STG2$=FS2Mem.ReadStr(42)
FLong=INSTR(STG2$, EDITSTG$) : INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
FS1Mem.Position=SRCHPOS-42 : STG1$=FS1Mem.ReadStr(42)
DS1Mem.Position=SRCHPOS-42 : STG3$=DS1Mem.ReadStr(42)
DS2Mem.Position=SRCHPOS-42 : STG4$=DS2Mem.ReadStr(42) : Show_SSearch(1)
ELSE
SRCHSTS=2 : Label16.Caption="End of Search"
Canvas4.FillRect (212, 173, 761, 286, &H60B0E0)
END IF
ELSE
IF FLong>0 THEN
FS2Mem.Position=SRCHPOS-42 : STG2$=FS2Mem.ReadStr(42)
DS1Mem.Position=SRCHPOS-42 : STG3$=DS1Mem.ReadStr(42)
DS2Mem.Position=SRCHPOS-42 : STG4$=DS2Mem.ReadStr(42) : Show_SSearch(1)
END IF
END IF
END SUB

SUB Continue_FP
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
FPMem.Position=SRCHPOS : STG1$=FPMem.ReadStr(42) : FLong=INSTR(STG1$, EDITSTG$)
INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
DPMem.Position=SRCHPOS-42 : STG2$=DPMem.ReadStr(42) : Show_WSearch(1)
ELSE
SRCHSTS=2 : Label16.Caption="End of Search"
END IF
END SUB

SUB Continue_FJ
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
FJMem.Position=SRCHPOS : STG1$=FJMem.ReadStr(42) : FLong=INSTR(STG1$, EDITSTG$)
INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
DJMem.Position=SRCHPOS-42 : STG2$=DJMem.ReadStr(42) : Show_WSearch(1)
ELSE
SRCHSTS=2 : Label16.Caption="End of Search"
END IF
END SUB

SUB Continue_FV
WHILE (FLong=0 AND SRCHPOS<=(BLen(CURCP+44)*42))
FVMem.Position=SRCHPOS : STG1$=FVMem.ReadStr(42) : FLong=INSTR(STG1$, EDITSTG$)
INC (SRCHPOS, 42)
WEND
IF FLong>0 THEN
DVMem.Position=SRCHPOS-42 : STG2$=DVMem.ReadStr(42) : Show_WSearch(1)
ELSE
SRCHSTS=2 : Label16.Caption="End of Search"
END IF
END SUB

SUB Continue_WS
FLong=0
IF SRCHSTS=1 THEN
IF CURDF=0 THEN
IF CURPAA=0 THEN
Continue_DS
ELSEIF CURPAA=1 THEN
Continue_DP
ELSEIF CURPAA=2 THEN
Continue_DJ
ELSEIF CURPAA=3 THEN
Continue_DV
END IF
ELSE
IF CURPAA=0 THEN
Continue_FS
ELSEIF CURPAA=1 THEN
Continue_FP
ELSEIF CURPAA=2 THEN
Continue_FJ
ELSEIF CURPAA=3 THEN
Continue_FV
END IF
END IF
END IF
END SUB

SUB Clear_Words
Canvas1.FillRect (210, 169, 778, 201, &HA8CCE0)
Canvas1.FillRect (210, 217, 778, 249, &HA8CCE0)
Canvas1.FillRect (210, 265, 778, 297, &HA8CCE0)
Canvas1.FillRect (210, 313, 778, 345, &HA8CCE0)
Canvas1.FillRect (210, 361, 778, 393, &HA8CCE0)
Canvas1.FillRect (210, 409, 778, 441, &HA8CCE0)
END SUB

SUB Clear_Sentences
Canvas1.FillRect (210, 16, 778, 75, &HA8CCE0)
Canvas1.FillRect (210, 92, 778, 153, &HA8CCE0)
END SUB

SUB Spell_DSentences
POSPTR=CURSEQ*42 : YY=42 : DO : DEC YY : DS1Mem.Position=POSPTR+YY : FByte=DS1Mem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
FOR Z=1 TO YY : DS1Mem.Position=POSPTR : FStg$=DS1Mem.ReadStr(Z)
Canvas1.FillRect (210, 15, 778, 47, &HA8CCE0)
Canvas1.TextOut (221, 16, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
YY=42 : DO : DEC YY : DS2Mem.Position=POSPTR+YY : FByte=DS2Mem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
IF DFDELAY>0 THEN SLEEP DFDELAY
FOR Z=1 TO YY : DS2Mem.Position=POSPTR : FStg$=DS2Mem.ReadStr(Z)
Canvas1.FillRect (210, 43, 778, 75, &HA8CCE0)
Canvas1.TextOut (221, 44, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
END SUB

SUB Show_DSentences
POSPTR=CURSEQ*42 : DS1Mem.Position=POSPTR : FStg$=DS1Mem.ReadStr(42) : Canvas1.TextOut (221, 16, FStg$, &HFFFFFF, -1)
IF DFDELAY>0 THEN SLEEP DFDELAY
DS2Mem.Position=POSPTR : FStg$=DS2Mem.ReadStr(42) : Canvas1.TextOut (221, 44, FStg$, &HFFFFFF, -1)
END SUB

SUB Spell_FSentences
POSPTR=CURSEQ*42 : YY=42 : DO : DEC YY : FS1Mem.Position=POSPTR+YY : FByte=FS1Mem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
FOR Z=1 TO YY : FS1Mem.Position=POSPTR : FStg$=FS1Mem.ReadStr(Z)
Canvas1.FillRect (210, 92, 778, 124, &HA8CCE0)
Canvas1.TextOut (221, 93, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
YY=42 : DO : DEC YY : FS2Mem.Position=POSPTR+YY : FByte=FS2Mem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
IF DFDELAY>0 THEN SLEEP DFDELAY
FOR Z=1 TO YY : FS2Mem.Position=POSPTR : FStg$=FS2Mem.ReadStr(Z)
Canvas1.FillRect (210, 125, 778, 153, &HA8CCE0)
Canvas1.TextOut (221, 121, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
END SUB

SUB Show_FSentences
POSPTR=CURSEQ*42 : FS1Mem.Position=POSPTR : FStg$=FS1Mem.ReadStr(42) : Canvas1.TextOut (221, 93, FStg$, &H284C60, -1)
IF DFDELAY>0 THEN SLEEP DFDELAY
FS2Mem.Position=POSPTR : FStg$=FS2Mem.ReadStr(42) : Canvas1.TextOut (221, 121, FStg$, &H284C60, -1)
END SUB

SUB Next_Sentences
Clear_Sentences
IF DS=1 THEN
IF SPELL=1 THEN
Spell_DSentences
ELSE
Show_DSentences
END IF
END IF
IF (DS=1 AND FS=1 AND RVDELAY>0) THEN SLEEP RVDELAY
IF FS=1 THEN
IF SPELL=1 THEN
Spell_FSentences
ELSE
Show_FSentences
END IF
END IF
IF (DS=1 AND FS=1 AND MN=1 AND AMDELAY>0) THEN SLEEP AMDELAY
OLDSEQ=CURSEQ
IF SEQRND=0 THEN
INC CURSEQ : IF CURSEQ>BLen(CURCP) THEN CURSEQ=ALen(CURCP)
ELSE
CURSEQ=ALen(CURCP)+RND(CLen(CURCP))-1 : IF CURSEQ<ALen(CURCP) THEN CURSEQ=ALen(CURCP)
END IF
NX=1 : FWD=0 : NEXTSEQ=CURSEQ
END SUB

SUB Reveal_Sentences
IF NX=1 THEN
CURSEQ=OLDSEQ : NX=2
IF (DS=0 AND FS=1) THEN
IF SPELL=1 THEN
Spell_DSentences
ELSE
Show_DSentences
END IF
ELSEIF (DS=1 AND FS=0) THEN
IF SPELL=1 THEN
Spell_FSentences
ELSE
Show_FSentences
END IF
END IF
CURSEQ=NEXTSEQ : NX=0
END IF
END SUB

SUB Spell_DPWords
POSPTR=CURSEQ*42 : YY=42 : DO : DEC YY : DPMem.Position=POSPTR+YY : FByte=DPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF SPLIT=0 THEN
IF YY>0 THEN
FOR Z=1 TO YY : DPMem.Position=POSPTR : FStg$=DPMem.ReadStr(Z)
Canvas1.FillRect (210, 169, 778, 201, &HA8CCE0)
Canvas1.TextOut (221, 171, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
ELSE
COUNT=YY : IF COUNT>0 THEN
POSPTR=CURSEQ*42 : YY=14 : DO : DEC YY : DPMem.Position=POSPTR+YY : FByte=DPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DPMem.Position=POSPTR : FStg$=DPMem.ReadStr(Z)
Canvas1.FillRect (210, 169, 399, 201, &HA8CCE0)
Canvas1.TextOut (221, 171, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>14 THEN
POSPTR=(CURSEQ*42)+14 : YY=14 : DO : DEC YY : DPMem.Position=POSPTR+YY : FByte=DPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DPMem.Position=POSPTR : FStg$=DPMem.ReadStr(Z)
Canvas1.FillRect (400, 169, 589, 201, &HA8CCE0)
Canvas1.TextOut (379, 171, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>28 THEN
POSPTR=(CURSEQ*42)+28 : YY=14 : DO : DEC YY : DPMem.Position=POSPTR+YY : FByte=DPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DPMem.Position=POSPTR : FStg$=DPMem.ReadStr(Z)
Canvas1.FillRect (590, 169, 778, 201, &HA8CCE0)
Canvas1.TextOut (601, 171, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Spell_FPWords
POSPTR=CURSEQ*42 : YY=42 : DO : DEC YY : FPMem.Position=POSPTR+YY : FByte=FPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF SPLIT=0 THEN
IF YY>0 THEN
FOR Z=1 TO YY : FPMem.Position=POSPTR : FStg$=FPMem.ReadStr(Z)
Canvas1.FillRect (210, 217, 778, 249, &HA8CCE0)
Canvas1.TextOut (221, 218, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
ELSE
COUNT=YY : IF COUNT>0 THEN
POSPTR=CURSEQ*42 : YY=14 : DO : DEC YY : FPMem.Position=POSPTR+YY : FByte=FPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FPMem.Position=POSPTR : FStg$=FPMem.ReadStr(Z)
Canvas1.FillRect (210, 217, 399, 249, &HA8CCE0)
Canvas1.TextOut (221, 218, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>14 THEN
POSPTR=(CURSEQ*42)+14 : YY=14 : DO : DEC YY : FPMem.Position=POSPTR+YY : FByte=FPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FPMem.Position=POSPTR : FStg$=FPMem.ReadStr(Z)
Canvas1.FillRect (400, 217, 589, 249, &HA8CCE0)
Canvas1.TextOut (379, 218, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>28 THEN
POSPTR=(CURSEQ*42)+28 : YY=14 : DO : DEC YY : FPMem.Position=POSPTR+YY : FByte=FPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FPMem.Position=POSPTR : FStg$=FPMem.ReadStr(Z)
Canvas1.FillRect (590, 217, 778, 249, &HA8CCE0)
Canvas1.TextOut (601, 218, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Spell_DJWords
POSPTR=CURSEQ*42 : YY=42 : DO : DEC YY : DJMem.Position=POSPTR+YY : FByte=DJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF SPLIT=0 THEN
IF YY>0 THEN
FOR Z=1 TO YY : DJMem.Position=POSPTR : FStg$=DJMem.ReadStr(Z)
Canvas1.FillRect (210, 265, 778, 297, &HA8CCE0)
Canvas1.TextOut (221, 266, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
ELSE
COUNT=YY : IF COUNT>0 THEN
POSPTR=CURSEQ*42 : YY=14 : DO : DEC YY : DJMem.Position=POSPTR+YY : FByte=DJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DJMem.Position=POSPTR : FStg$=DJMem.ReadStr(Z)
Canvas1.FillRect (210, 265, 399, 297, &HA8CCE0)
Canvas1.TextOut (221, 266, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>14 THEN
POSPTR=(CURSEQ*42)+14 : YY=14 : DO : DEC YY : DJMem.Position=POSPTR+YY : FByte=DJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DJMem.Position=POSPTR : FStg$=DJMem.ReadStr(Z)
Canvas1.FillRect (400, 265, 589, 297, &HA8CCE0)
Canvas1.TextOut (379, 266, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>28 THEN
POSPTR=(CURSEQ*42)+28 : YY=14 : DO : DEC YY : DJMem.Position=POSPTR+YY : FByte=DJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DJMem.Position=POSPTR : FStg$=DJMem.ReadStr(Z)
Canvas1.FillRect (590, 265, 778, 297, &HA8CCE0)
Canvas1.TextOut (601, 266, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Spell_FJWords
POSPTR=CURSEQ*42 : YY=42 : DO : DEC YY : FJMem.Position=POSPTR+YY : FByte=FJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF SPLIT=0 THEN
IF YY>0 THEN
FOR Z=1 TO YY : FJMem.Position=POSPTR : FStg$=FJMem.ReadStr(Z)
Canvas1.FillRect (210, 313, 778, 345, &HA8CCE0)
Canvas1.TextOut (221, 314, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
ELSE
COUNT=YY : IF COUNT>0 THEN
POSPTR=CURSEQ*42 : YY=14 : DO : DEC YY : FJMem.Position=POSPTR+YY : FByte=FJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FJMem.Position=POSPTR : FStg$=FJMem.ReadStr(Z)
Canvas1.FillRect (210, 313, 399, 345, &HA8CCE0)
Canvas1.TextOut (221, 314, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>14 THEN
POSPTR=(CURSEQ*42)+14 : YY=14 : DO : DEC YY : FJMem.Position=POSPTR+YY : FByte=FJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FJMem.Position=POSPTR : FStg$=FJMem.ReadStr(Z)
Canvas1.FillRect (400, 313, 589, 345, &HA8CCE0)
Canvas1.TextOut (379, 314, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>28 THEN
POSPTR=(CURSEQ*42)+28 : YY=14 : DO : DEC YY : FJMem.Position=POSPTR+YY : FByte=FJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FJMem.Position=POSPTR : FStg$=FJMem.ReadStr(Z)
Canvas1.FillRect (590, 313, 778, 345, &HA8CCE0)
Canvas1.TextOut (601, 314, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Spell_DVWords
POSPTR=CURSEQ*42 : YY=42 : DO : DEC YY : DVMem.Position=POSPTR+YY : FByte=DVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF SPLIT=0 THEN
IF YY>0 THEN
FOR Z=1 TO YY : DVMem.Position=POSPTR : FStg$=DVMem.ReadStr(Z)
Canvas1.FillRect (210, 361, 778, 393, &HA8CCE0)
Canvas1.TextOut (221, 362, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
ELSE
COUNT=YY : IF COUNT>0 THEN
POSPTR=CURSEQ*42 : YY=14 : DO : DEC YY : DVMem.Position=POSPTR+YY : FByte=DVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DVMem.Position=POSPTR : FStg$=DVMem.ReadStr(Z)
Canvas1.FillRect (210, 361, 399, 393, &HA8CCE0)
Canvas1.TextOut (221, 362, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>14 THEN
POSPTR=(CURSEQ*42)+14 : YY=14 : DO : DEC YY : DVMem.Position=POSPTR+YY : FByte=DVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DVMem.Position=POSPTR : FStg$=DVMem.ReadStr(Z)
Canvas1.FillRect (400, 361, 589, 393, &HA8CCE0)
Canvas1.TextOut (379, 362, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>28 THEN
POSPTR=(CURSEQ*42)+28 : YY=14 : DO : DEC YY : DVMem.Position=POSPTR+YY : FByte=DVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : DVMem.Position=POSPTR : FStg$=DVMem.ReadStr(Z)
Canvas1.FillRect (590, 361, 778, 393, &HA8CCE0)
Canvas1.TextOut (601, 362, FStg$, &HFFFFFF, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Spell_FVWords
POSPTR=CURSEQ*42 : YY=42 : DO : DEC YY : FVMem.Position=POSPTR+YY : FByte=FVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF SPLIT=0 THEN
IF YY>0 THEN
FOR Z=1 TO YY : FVMem.Position=POSPTR : FStg$=FVMem.ReadStr(Z)
Canvas1.FillRect (210, 409, 778, 441, &HA8CCE0)
Canvas1.TextOut (221, 410, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
END IF
ELSE
COUNT=YY : IF COUNT>0 THEN
POSPTR=CURSEQ*42 : YY=14 : DO : DEC YY : FVMem.Position=POSPTR+YY : FByte=FVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FVMem.Position=POSPTR : FStg$=FVMem.ReadStr(Z)
Canvas1.FillRect (210, 409, 399, 441, &HA8CCE0)
Canvas1.TextOut (221, 410, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>14 THEN
POSPTR=(CURSEQ*42)+14 : YY=14 : DO : DEC YY : FVMem.Position=POSPTR+YY : FByte=FVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FVMem.Position=POSPTR : FStg$=FVMem.ReadStr(Z)
Canvas1.FillRect (400, 409, 589, 441, &HA8CCE0)
Canvas1.TextOut (379, 410, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF (COUNT>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF COUNT>28 THEN
POSPTR=(CURSEQ*42)+28 : YY=14 : DO : DEC YY : FVMem.Position=POSPTR+YY : FByte=FVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
FOR Z=1 TO YY : FVMem.Position=POSPTR : FStg$=FVMem.ReadStr(Z)
Canvas1.FillRect (590, 409, 778, 441, &HA8CCE0)
Canvas1.TextOut (601, 410, FStg$, &H284C60, -1)
IF SPDELAY>0 THEN SLEEP SPDELAY
NEXT
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Show_DPWords
POSPTR=CURSEQ*42 : IF SPLIT=0 THEN
DPMem.Position=POSPTR : FStg$=DPMem.ReadStr(42) : Canvas1.TextOut (221, 171, FStg$, &HFFFFFF, -1)
ELSE
YY=42 : DO : DEC YY : DPMem.Position=POSPTR+YY : FByte=DPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
DPMem.Position=POSPTR : FStg$=DPMem.ReadStr(14) : Canvas1.TextOut (221, 171, FStg$, &HFFFFFF, -1)
IF (YY>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>14 THEN
DPMem.Position=POSPTR+14 : FStg$=DPMem.ReadStr(14) : Canvas1.TextOut (379, 171, FStg$, &HFFFFFF, -1)
IF (YY>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>28 THEN
DPMem.Position=POSPTR+28 : FStg$=DPMem.ReadStr(14) : Canvas1.TextOut (601, 171, FStg$, &HFFFFFF, -1)
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Show_FPWords
POSPTR=CURSEQ*42 : IF SPLIT=0 THEN
FPMem.Position=POSPTR : FStg$=FPMem.ReadStr(42) : Canvas1.TextOut (221, 218, FStg$, &H284C60, -1)
ELSE
YY=42 : DO : DEC YY : FPMem.Position=POSPTR+YY : FByte=FPMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
FPMem.Position=POSPTR : FStg$=FPMem.ReadStr(14) : Canvas1.TextOut (221, 218, FStg$, &H284C60, -1)
IF (YY>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>14 THEN
FPMem.Position=POSPTR+14 : FStg$=FPMem.ReadStr(14) : Canvas1.TextOut (379, 218, FStg$, &H284C60, -1)
IF (YY>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>28 THEN
FPMem.Position=POSPTR+28 : FStg$=FPMem.ReadStr(14) : Canvas1.TextOut (601, 218, FStg$, &H284C60, -1)
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Show_DJWords
POSPTR=CURSEQ*42 : IF SPLIT=0 THEN
DJMem.Position=POSPTR : FStg$=DJMem.ReadStr(42) : Canvas1.TextOut (221, 266, FStg$, &HFFFFFF, -1)
ELSE
YY=42 : DO : DEC YY : DJMem.Position=POSPTR+YY : FByte=DJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
DJMem.Position=POSPTR : FStg$=DJMem.ReadStr(14) : Canvas1.TextOut (221, 266, FStg$, &HFFFFFF, -1)
IF (YY>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>14 THEN
DJMem.Position=POSPTR+14 : FStg$=DJMem.ReadStr(14) : Canvas1.TextOut (379, 266, FStg$, &HFFFFFF, -1)
IF (YY>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>28 THEN
DJMem.Position=POSPTR+28 : FStg$=DJMem.ReadStr(14) : Canvas1.TextOut (601, 266, FStg$, &HFFFFFF, -1)
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Show_FJWords
POSPTR=CURSEQ*42 : IF SPLIT=0 THEN
FJMem.Position=POSPTR : FStg$=FJMem.ReadStr(42) : Canvas1.TextOut (221, 314, FStg$, &H284C60, -1)
ELSE
YY=42 : DO : DEC YY : FJMem.Position=POSPTR+YY : FByte=FJMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
FJMem.Position=POSPTR : FStg$=FJMem.ReadStr(14) : Canvas1.TextOut (221, 314, FStg$, &H284C60, -1)
IF (YY>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>14 THEN
FJMem.Position=POSPTR+14 : FStg$=FJMem.ReadStr(14) : Canvas1.TextOut (379, 314, FStg$, &H284C60, -1)
IF (YY>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>28 THEN
FJMem.Position=POSPTR+28 : FStg$=FJMem.ReadStr(14) : Canvas1.TextOut (601, 314, FStg$, &H284C60, -1)
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Show_DVWords
POSPTR=CURSEQ*42 : IF SPLIT=0 THEN
DVMem.Position=POSPTR : FStg$=DVMem.ReadStr(42) : Canvas1.TextOut (221, 362, FStg$, &HFFFFFF, -1)
ELSE
YY=42 : DO : DEC YY : DVMem.Position=POSPTR+YY : FByte=DVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
DVMem.Position=POSPTR : FStg$=DVMem.ReadStr(14) : Canvas1.TextOut (221, 362, FStg$, &HFFFFFF, -1)
IF (YY>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>14 THEN
DVMem.Position=POSPTR+14 : FStg$=DVMem.ReadStr(14) : Canvas1.TextOut (379, 362, FStg$, &HFFFFFF, -1)
IF (YY>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>28 THEN
DVMem.Position=POSPTR+28 : FStg$=DVMem.ReadStr(14) : Canvas1.TextOut (601, 362, FStg$, &HFFFFFF, -1)
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Show_FVWords
POSPTR=CURSEQ*42 : IF SPLIT=0 THEN
FVMem.Position=POSPTR : FStg$=FVMem.ReadStr(42) : Canvas1.TextOut (221, 410, FStg$, &H284C60, -1)
ELSE
YY=42 : DO : DEC YY : FVMem.Position=POSPTR+YY : FByte=FVMem.ReadNum(1) : LOOP UNTIL (FByte<>32 OR YY=0)
IF (YY>=0 AND FByte<>32) THEN INC YY
IF YY>0 THEN
FVMem.Position=POSPTR : FStg$=FVMem.ReadStr(14) : Canvas1.TextOut (221, 410, FStg$, &H284C60, -1)
IF (YY>14 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>14 THEN
FVMem.Position=POSPTR+14 : FStg$=FVMem.ReadStr(14) : Canvas1.TextOut (379, 410, FStg$, &H284C60, -1)
IF (YY>28 AND WSDELAY>0) THEN SLEEP WSDELAY
END IF
IF YY>28 THEN
FVMem.Position=POSPTR+28 : FStg$=FVMem.ReadStr(14) : Canvas1.TextOut (601, 410, FStg$, &H284C60, -1)
IF WSDELAY>0 THEN SLEEP WSDELAY
END IF
END IF
END SUB

SUB Next_Words
Clear_Words
IF DP=1 THEN
IF SPELL=1 THEN
Spell_DPWords
ELSE
Show_DPWords
END IF
END IF
IF (DP=1 AND FP=1 AND RVDELAY>0) THEN SLEEP RVDELAY
IF FP=1 THEN
IF SPELL=1 THEN
Spell_FPWords
ELSE
Show_FPWords
END IF
END IF
IF (DP=1 AND FP=1 AND NAVDELAY>0) THEN SLEEP NAVDELAY
IF DJ=1 THEN
IF SPELL=1 THEN
Spell_DJWords
ELSE
Show_DJWords
END IF
END IF
IF (DJ=1 AND FJ=1 AND RVDELAY>0) THEN SLEEP RVDELAY
IF FJ=1 THEN
IF SPELL=1 THEN
Spell_FJWords
ELSE
Show_FJWords
END IF
END IF
IF (DJ=1 AND FJ=1 AND NAVDELAY>0) THEN SLEEP NAVDELAY
IF DV=1 THEN
IF SPELL=1 THEN
Spell_DVWords
ELSE
Show_DVWords
END IF
END IF
IF (DV=1 AND FV=1 AND RVDELAY>0) THEN SLEEP RVDELAY
IF FV=1 THEN
IF SPELL=1 THEN
Spell_FVWords
ELSE
Show_FVWords
END IF
END IF
IF (DV=1 AND FV=1 AND NAVDELAY>0) THEN SLEEP NAVDELAY
OLDSEQ=CURSEQ
IF SEQRND=0 THEN
INC CURSEQ : IF CURSEQ>BLen(CURCP+44) THEN CURSEQ=ALen(CURCP+44)
ELSE
CURSEQ=ALen(CURCP+44)+RND(CLen(CURCP+44))-1 : IF CURSEQ<ALen(CURCP+44) THEN CURSEQ=ALen(CURCP+44)
END IF
NX=1 : FWD=0 : NEXTSEQ=CURSEQ
END SUB

SUB Reveal_Words
IF NX=1 THEN
CURSEQ=OLDSEQ : NX=2
IF (DP=0 AND FP=1) THEN
IF SPELL=1 THEN
Spell_DPWords
ELSE
Show_DPWords
END IF
ELSEIF (DP=1 AND FP=0) THEN
IF SPELL=1 THEN
Spell_FPWords
ELSE
Show_FPWords
END IF
END IF
IF (DJ=0 AND FJ=1) THEN
IF SPELL=1 THEN
Spell_DJWords
ELSE
Show_DJWords
END IF
ELSEIF (DJ=1 AND FJ=0) THEN
IF SPELL=1 THEN
Spell_FJWords
ELSE
Show_FJWords
END IF
END IF
IF (DV=0 AND FV=1) THEN
IF SPELL=1 THEN
Spell_DVWords
ELSE
Show_DVWords
END IF
ELSEIF (DV=1 AND FV=0) THEN
IF SPELL=1 THEN
Spell_FVWords
ELSE
Show_FVWords
END IF
END IF
CURSEQ=NEXTSEQ : NX=0
END IF
END SUB

SUB Show_Up
POSPTR=CURSEQ*42 : IF LRN=0 THEN
DPMem.Position=POSPTR : FStg$=DPMem.ReadStr(42) : Canvas1.TextOut (221, 171, FStg$, &HFFFFFF, -1)
FPMem.Position=POSPTR : FStg$=FPMem.ReadStr(42) : Canvas1.TextOut (221, 218, FStg$, &H284C60, -1)
DJMem.Position=POSPTR : FStg$=DJMem.ReadStr(42) : Canvas1.TextOut (221, 266, FStg$, &HFFFFFF, -1)
FJMem.Position=POSPTR : FStg$=FJMem.ReadStr(42) : Canvas1.TextOut (221, 314, FStg$, &H284C60, -1)
DVMem.Position=POSPTR : FStg$=DVMem.ReadStr(42) : Canvas1.TextOut (221, 362, FStg$, &HFFFFFF, -1)
FVMem.Position=POSPTR : FStg$=FVMem.ReadStr(42) : Canvas1.TextOut (221, 410, FStg$, &H284C60, -1)
ELSE
DS1Mem.Position=POSPTR : FStg$=DS1Mem.ReadStr(42) : Canvas1.TextOut (221, 16, FStg$, &HFFFFFF, -1)
DS2Mem.Position=POSPTR : FStg$=DS2Mem.ReadStr(42) : Canvas1.TextOut (221, 44, FStg$, &HFFFFFF, -1)
FS1Mem.Position=POSPTR : FStg$=FS1Mem.ReadStr(42) : Canvas1.TextOut (221, 93, FStg$, &H284C60, -1)
FS2Mem.Position=POSPTR : FStg$=FS2Mem.ReadStr(42) : Canvas1.TextOut (221, 121, FStg$, &H284C60, -1)
END IF
END SUB

SUB Show_Down
OLDSEQ=CURSEQ : POSPTR=CURSEQ*42 : IF LRN=0 THEN
DPMem.Position=POSPTR : FStg$=DPMem.ReadStr(42) : Canvas1.TextOut (221, 171, FStg$, &HFFFFFF, -1)
FPMem.Position=POSPTR : FStg$=FPMem.ReadStr(42) : Canvas1.TextOut (221, 218, FStg$, &H284C60, -1)
DJMem.Position=POSPTR : FStg$=DJMem.ReadStr(42) : Canvas1.TextOut (221, 266, FStg$, &HFFFFFF, -1)
FJMem.Position=POSPTR : FStg$=FJMem.ReadStr(42) : Canvas1.TextOut (221, 314, FStg$, &H284C60, -1)
DVMem.Position=POSPTR : FStg$=DVMem.ReadStr(42) : Canvas1.TextOut (221, 362, FStg$, &HFFFFFF, -1)
FVMem.Position=POSPTR : FStg$=FVMem.ReadStr(42) : Canvas1.TextOut (221, 410, FStg$, &H284C60, -1)
ELSE
DS1Mem.Position=POSPTR : FStg$=DS1Mem.ReadStr(42) : Canvas1.TextOut (221, 16, FStg$, &HFFFFFF, -1)
DS2Mem.Position=POSPTR : FStg$=DS2Mem.ReadStr(42) : Canvas1.TextOut (221, 44, FStg$, &HFFFFFF, -1)
FS1Mem.Position=POSPTR : FStg$=FS1Mem.ReadStr(42) : Canvas1.TextOut (221, 93, FStg$, &H284C60, -1)
FS2Mem.Position=POSPTR : FStg$=FS2Mem.ReadStr(42) : Canvas1.TextOut (221, 121, FStg$, &H284C60, -1)
END IF
END SUB

SUB Up_SW
IF LRN=0 THEN
Clear_Words : Show_Up : OLDSEQ=CURSEQ : INC CURSEQ : IF CURSEQ>BLen(CURCP+44) THEN CURSEQ=ALen(CURCP+44)
ELSE
Clear_Sentences : Show_Up : OLDSEQ=CURSEQ : INC CURSEQ : IF CURSEQ>BLen(CURCP) THEN CURSEQ=ALen(CURCP)
END IF
NEXTSEQ=CURSEQ : NX=1 : FWD=0
END SUB

SUB Down_SW
NEXTSEQ=OLDSEQ : CURSEQ=OLDSEQ : DEC CURSEQ
IF LRN=0 THEN
Clear_Words : IF CURSEQ<ALen(CURCP+44) THEN CURSEQ=BLen(CURCP+44)
Show_Down
ELSE
Clear_Sentences : IF CURSEQ<ALen(CURCP) THEN CURSEQ=BLen(CURCP)
Show_Down
END IF
CURSEQ=NEXTSEQ : NX=1 : FWD=1
END SUB

SUB LDS1_Check (Number AS BYTE)
File.Close
IF COUNT<9 THEN
ShowMessage(FName$(Number)+"\n\n                  A @ marker is missing  -  CATEGORY: "+Chr$(49+COUNT))
ELSEIF (COUNT>8 AND COUNT<19) THEN
ShowMessage(FName$(Number)+"\n\n                  A @ marker is missing  -  CATEGORY: 1"+Chr$(48+(COUNT-9)))
ELSEIF (COUNT>18 AND COUNT<29) THEN
ShowMessage(FName$(Number)+"\n\n                  A @ marker is missing  -  CATEGORY: 2"+Chr$(48+(COUNT-19)))
END IF
Application.Terminate
END SUB

SUB LDS2_Check (Number AS BYTE)
File.Close
IF COUNT<9 THEN
ShowMessage(FName$(Number)+"\n\nWord/Sentence declaration is out of Range 2-1500  -  CATEGORY: "+Chr$(49+COUNT))
ELSEIF (COUNT>8 AND COUNT<19) THEN
ShowMessage(FName$(Number)+"\n\nWord/Sentence declaration is out of Range 2-1500  -  CATEGORY: 1"+Chr$(48+(COUNT-9)))
ELSEIF (COUNT>18 AND COUNT<29) THEN
ShowMessage(FName$(Number)+"\n\nWord/Sentence declaration is out of Range 2-1500  -  CATEGORY: 2"+Chr$(48+(COUNT-19)))
END IF
Application.Terminate
END SUB

SUB LDS3_Check (Number AS BYTE)
File.Close
IF COUNT<9 THEN
ShowMessage(FName$(Number)+"\n\nA * marker is missing  -  CATEGORY: "+Chr$(49+COUNT))
ELSEIF (COUNT>8 AND COUNT<19) THEN
ShowMessage(FName$(Number)+"\n\nA * marker is missing  -  CATEGORY: 1"+Chr$(48+(COUNT-9)))
ELSEIF (COUNT>18 AND COUNT<29) THEN
ShowMessage(FName$(Number)+"\n\nA * marker is missing  -  CATEGORY: 2"+Chr$(48+(COUNT-19)))
END IF
Application.Terminate
END SUB

SUB Load_Files (Number AS BYTE)
Totals(Number)=0 : COUNT=0
IF DirExists (DName$(0)) <> 0 THEN
IF FileExists (FName$(Number)) <> 0 THEN
IF File.Open (FName$(Number), fmOpenRead) <> 0 THEN
FLen=File.Size
IF (FLen>=4094 AND FLen<103000) THEN
DO
FByte=File.ReadNum(1)
IF FByte=64 THEN
FStg$=File.ReadBinStr(4) : FWord=VAL(FStg$)
IF (FWord>1 AND FWord<1501) THEN
File.Position=File.Position+2
IF Number=2 THEN
CLen(COUNT)=FWord
ALen(COUNT)=Totals(Number)
Totals(Number)=Totals(Number)+FWord
BLen(COUNT)=Totals(Number)-1
FOR Z=1 TO FWord : DS1Mem.CopyFrom(File, 42) : File.Position=File.Position+2
DS2Mem.CopyFrom(File, 42) : File.Position=File.Position+2 : NEXT
ELSEIF Number=3 THEN
CLen(COUNT+22)=FWord
ALen(COUNT+22)=Totals(Number)
Totals(Number)=Totals(Number)+FWord
BLen(COUNT+22)=Totals(Number)-1
FOR Z=1 TO FWord : FS1Mem.CopyFrom(File, 42) : File.Position=File.Position+2
FS2Mem.CopyFrom(File, 42) : File.Position=File.Position+2 : NEXT
ELSEIF Number=4 THEN
CLen(COUNT+44)=FWord
ALen(COUNT+44)=Totals(Number)
Totals(Number)=Totals(Number)+FWord
BLen(COUNT+44)=Totals(Number)-1
FOR Z=1 TO FWord : DPMem.CopyFrom(File, 42) : File.Position=File.Position+2 : NEXT
ELSEIF Number=5 THEN
CLen(COUNT+66)=FWord
ALen(COUNT+66)=Totals(Number)
Totals(Number)=Totals(Number)+FWord
BLen(COUNT+66)=Totals(Number)-1
FOR Z=1 TO FWord : FPMem.CopyFrom(File, 42) : File.Position=File.Position+2 : NEXT
ELSEIF Number=6 THEN
CLen(COUNT+88)=FWord
ALen(COUNT+88)=Totals(Number)
Totals(Number)=Totals(Number)+FWord
BLen(COUNT+88)=Totals(Number)-1
FOR Z=1 TO FWord : DJMem.CopyFrom(File, 42) : File.Position=File.Position+2 : NEXT
ELSEIF Number=7 THEN
CLen(COUNT+110)=FWord
ALen(COUNT+110)=Totals(Number)
Totals(Number)=Totals(Number)+FWord
BLen(COUNT+110)=Totals(Number)-1
FOR Z=1 TO FWord : FJMem.CopyFrom(File, 42) : File.Position=File.Position+2 : NEXT
ELSEIF Number=8 THEN
CLen(COUNT+132)=FWord
ALen(COUNT+132)=Totals(Number)
Totals(Number)=Totals(Number)+FWord
BLen(COUNT+132)=Totals(Number)-1
FOR Z=1 TO FWord : DVMem.CopyFrom(File, 42) : File.Position=File.Position+2 : NEXT
ELSEIF Number=9 THEN
CLen(COUNT+154)=FWord
ALen(COUNT+154)=Totals(Number)
Totals(Number)=Totals(Number)+FWord
BLen(COUNT+154)=Totals(Number)-1
FOR Z=1 TO FWord : FVMem.CopyFrom(File, 42) : File.Position=File.Position+2 : NEXT
END IF
FByte=File.ReadNum(1)
IF FByte=42 THEN
File.Position=File.Position+2
INC COUNT
ELSE
LDS3_Check(Number)
END IF
ELSE
LDS2_Check(Number)
END IF
ELSE
LDS1_Check(Number)
END IF
LOOP UNTIL COUNT=22
File.Close
ELSE
File.Close
ShowMessage(FName$(Number)+"\n\nWrong File Size  (not between 4094 and 99000 Bytes in size)")
Application.Terminate
END IF
ELSE
ShowMessage(FName$(Number)+"\n\n                     The above file was Not Loaded")
Application.Terminate
END IF
ELSE
ShowMessage(FName$(Number)+"\n\n                     The above file was Not Found")
Application.Terminate
END IF
ELSE
ShowMessage(DName$(0)+"\n\nThis Directory/Folder was Not Found")
Application.Terminate
END IF
END SUB

SUB LT1_Check (Number AS BYTE)
IF YY<9 THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: "+Chr$(49+Z)+"    COLUMN: "+Chr$(49+YY))
ELSEIF (YY>8 AND YY<19) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: "+Chr$(49+Z)+"    COLUMN: 1"+Chr$(48+(YY-9)))
ELSEIF (YY>18 AND YY<29) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: "+Chr$(49+Z)+"    COLUMN: 2"+Chr$(48+(YY-19)))
END IF
END SUB

SUB LT2_Check (Number AS BYTE)
IF YY<9 THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 1"+Chr$(48+(Z-9))+"    COLUMN: "+Chr$(49+YY))
ELSEIF (YY>8 AND YY<19) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 1"+Chr$(48+(Z-9))+"    COLUMN: 1"+Chr$(48+(YY-9)))
ELSEIF (YY>18 AND YY<29) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 1"+Chr$(48+(Z-9))+"    COLUMN: 2"+Chr$(48+(YY-19)))
END IF
END SUB

SUB LT3_Check (Number AS BYTE)
IF YY<9 THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 2"+Chr$(48+(Z-19))+"    COLUMN: "+Chr$(49+YY))
ELSEIF (YY>8 AND YY<19) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 2"+Chr$(48+(Z-19))+"    COLUMN: 1"+Chr$(48+(YY-9)))
ELSEIF (YY>18 AND YY<29) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 2"+Chr$(48+(Z-19))+"    COLUMN: 2"+Chr$(48+(YY-19)))
END IF
END SUB

SUB LT4_Check (Number AS BYTE)
IF YY<9 THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 3"+Chr$(48+(Z-29))+"    COLUMN: "+Chr$(49+YY))
ELSEIF (YY>8 AND YY<19) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 3"+Chr$(48+(Z-29))+"    COLUMN: 1"+Chr$(48+(YY-9)))
ELSEIF (YY>18 AND YY<29) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 3"+Chr$(48+(Z-29))+"    COLUMN: 2"+Chr$(48+(YY-19)))
END IF
END SUB

SUB LT5_Check (Number AS BYTE)
IF YY<9 THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 4"+Chr$(48+(Z-39))+"    COLUMN: "+Chr$(49+YY))
ELSEIF (YY>8 AND YY<19) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 4"+Chr$(48+(Z-39))+"    COLUMN: 1"+Chr$(48+(YY-9)))
ELSEIF (YY>18 AND YY<29) THEN
ShowMessage(FName$(Number)+"\n\n             Invalid Character  -  LINE: 4"+Chr$(48+(Z-39))+"    COLUMN: 2"+Chr$(48+(YY-19)))
END IF
END SUB

SUB Load_Titles (Number AS BYTE)
IF DirExists (DName$(0)) <> 0 THEN
IF FileExists (FName$(Number)) <> 0 THEN
IF File.Open (FName$(Number), fmOpenRead) <> 0 THEN
FLen=File.Size : IF FLen=1366 THEN
FOR Z=0 TO 43 : FPos=File.Position : FOR YY=0 TO 28 : FByte=File.ReadNum(1)
IF (FByte<32 OR (FByte>125 AND FByte<191)) THEN
IF Z<9 THEN
LT1_Check(Number)
ELSEIF (Z>8 AND Z<19) THEN
LT2_Check(Number)
ELSEIF (Z>18 AND Z<29) THEN
LT3_Check(Number)
ELSEIF (Z>28 AND Z<39) THEN
LT4_Check(Number)
ELSEIF (Z>38 AND Z<49) THEN
LT5_Check(Number)
END IF
File.Close : Application.Terminate
END IF
NEXT
File.Position=FPos
IF Number=0 THEN
DTitles(Z)=File.ReadStr(29)
ELSE
FTitles(Z)=File.ReadStr(29)
END IF
File.Position=File.Position+2
NEXT
File.Close
ELSE
File.Close
IF FLen<1366 THEN
ShowMessage(FName$(Number)+"\n\n                         This Titles file is Too Small")
ELSEIF FLen>1366 THEN
ShowMessage(FName$(Number)+"\n\n                        This Titles file is Too Large")
END IF
Application.Terminate
END IF
ELSE
ShowMessage(FName$(Number)+"\n\n                        This Titles file was Not Loaded")
Application.Terminate
END IF
ELSE
ShowMessage(FName$(Number)+"\n\n                        This Titles file was Not Found")
Application.Terminate
END IF
ELSE
ShowMessage(DName$(0)+"\n\nThis Directory/Folder was Not Found")
Application.Terminate
END IF
END SUB

SUB Load_FNSpeech
IF DirExists (DName$(0)) <> 0 THEN
IF FileExists (FName$(13)) <> 0 THEN
IF File.Open (FName$(13), fmOpenRead) <> 0 THEN
FLen=File.Size : IF (FLen>30 AND FLen<70001) THEN
FStg$=File.ReadBinStr(4) : FWord=VAL(FStg$) : FNNUM=FWord
IF (FWord>0 AND FWord<1501) THEN
File.Position=File.Position+2 : COUNT=0
DO : FNFN$(COUNT+1)=File.ReadLine : FPos=File.Position : INC COUNT
LOOP UNTIL (COUNT=FNNUM OR FPos=>FLen)
IF COUNT=FNNUM THEN
COUNT=0 : DO : FStg$=File.ReadBinStr(4) : FWord=VAL(FStg$) : YY=FWord*25
IF (FWord>0 AND FWord<1501) THEN
File.Position=File.Position+2 : FNAss(FWord)=1 : COUNT=1 : Z=0
DO : FStg$=File.ReadBinStr(4) : FWord=VAL(FStg$)
IF (FWord>0 AND FWord<(FNNUM+1)) THEN
FNSyl(YY+Z)=FWord : INC Z
ELSE
IF (FWord=9999 AND Z=0) THEN
ShowMessage(FName$(13)+"\n\n              No Word  (WAV)  Assignment  -  Only 9999")
Application.Terminate
END IF
IF FWord<>9999 THEN
ShowMessage(FName$(13)+"\n\nNumber of WAVs files declared is Out Of Range [1-"+Str$(FNNUM)+"]\nAssignment "+Str$(FWord)+"  -  Or a 9999 marker is Invalid")
Application.Terminate
END IF
END IF
LOOP UNTIL (FWord=9999 AND Z>0)
File.Position=File.Position+2
IF Z>26 THEN
ShowMessage(FName$(13)+"\n\n               Too many  ("+Str$(Z)+")  Word  (WAV)  Assignments")
Application.Terminate
ELSE
FNSyl(YY+Z)=-1 
END IF
ELSE
IF FWord<>8888 THEN
ShowMessage(FName$(13)+"\n\nSpeaking Word To Be Activated is Out Of Range [1-"+Str$(FNNUM)+"]\nWord Assignment "+Str$(FWord)+"  -  Or there are no Assignments")
Application.Terminate
END IF
IF (FWord=8888 AND COUNT=0) THEN
ShowMessage(FName$(13)+"\n\n                       There are no Word Assignments")
Application.Terminate
END IF
END IF
LOOP UNTIL (FWord=8888)
ELSE
ShowMessage(FName$(13)+"\n\n                                   Invalid File Format")
Application.Terminate
END IF
ELSE
ShowMessage(FName$(13)+"\n\nThe number of WAV files declared is Out Of Range [1-1500]")
Application.Terminate
END IF
File.Close
ELSE
File.Close
IF FLen<31 THEN
ShowMessage(FName$(13)+"\n\n                        This Speech file is Too Small")
ELSEIF FLen>70000 THEN
ShowMessage(FName$(13)+"\n\n                        This Speech file is Too Large")
END IF
Application.Terminate
END IF
ELSE
ShowMessage(FName$(13)+"\n\n                        This Speech file was Not Loaded")
Application.Terminate
END IF
ELSE
ShowMessage(FName$(13)+"\n\n                        This Speech file was Not Found")
Application.Terminate
END IF
ELSE
ShowMessage(DName$(LANG)+"\n\nThis Directory/Folder was Not Found")
Application.Terminate
END IF
END SUB

SUB Load_FSSpeech
IF DirExists (DName$(0)) <> 0 THEN
IF FileExists (FName$(11)) <> 0 THEN
IF File.Open (FName$(11), fmOpenRead) <> 0 THEN
FLen=File.Size : IF (FLen>30 AND FLen<70001) THEN
FStg$=File.ReadBinStr(4) : FWord=VAL(FStg$) : FSNUM=FWord
IF (FWord>0 AND FWord<1501) THEN
File.Position=File.Position+2 : COUNT=0
DO : FSFN$(COUNT+1)=File.ReadLine : FPos=File.Position : INC COUNT
LOOP UNTIL (COUNT=FSNUM OR FPos=>FLen)
IF COUNT=FSNUM THEN
COUNT=0 : DO : FStg$=File.ReadBinStr(4) : FWord=VAL(FStg$) : YY=FWord*25
IF (FWord>0 AND FWord<1501) THEN
File.Position=File.Position+2 : FSAss(FWord)=1 : COUNT=1 : Z=0
DO : FStg$=File.ReadBinStr(4) : FWord=VAL(FStg$)
IF (FWord>0 AND FWord<(FSNUM+1)) THEN
FSSyl(YY+Z)=FWord : INC Z
ELSE
IF (FWord=9999 AND Z=0) THEN
ShowMessage(FName$(11)+"\n\n          No Sentence  (WAV)  Assignment  -  Only 9999")
Application.Terminate
END IF
IF FWord<>9999 THEN
ShowMessage(FName$(11)+"\n\nNumber of WAVs files declared is Out Of Range [1-"+Str$(FSNUM)+"]\nAssignment "+Str$(FWord)+"  -  Or a 9999 marker is Invalid")
Application.Terminate
END IF
END IF
LOOP UNTIL (FWord=9999 AND Z>0)
File.Position=File.Position+2
IF Z>26 THEN
ShowMessage(FName$(11)+"\n\n           Too many  ("+Str$(Z)+")  Sentence  (WAV)  Assignments")
Application.Terminate
ELSE
FSSyl(YY+Z)=-1 
END IF
ELSE
IF FWord<>8888 THEN
ShowMessage(FName$(11)+"\n\nSpeaking Sentence To Be Activated is Out Of Range [1-"+Str$(FSNUM)+"]\nSentence Assignment "+Str$(FWord)+"  -  Or there are no Assignments")
Application.Terminate
END IF
IF (FWord=8888 AND COUNT=0) THEN
ShowMessage(FName$(11)+"\n\n                      There are no Sentence Assignments")
Application.Terminate
END IF
END IF
LOOP UNTIL (FWord=8888)
ELSE
ShowMessage(FName$(11)+"\n\n                                   Invalid File Format")
Application.Terminate
END IF
ELSE
ShowMessage(FName$(11)+"\n\nThe number of WAV files declared is Out Of Range [1-1500]")
Application.Terminate
END IF
File.Close
ELSE
File.Close
IF FLen<31 THEN
ShowMessage(FName$(11)+"\n\n                        This Speech file is Too Small")
ELSEIF FLen>70000 THEN
ShowMessage(FName$(11)+"\n\n                        This Speech file is Too Large")
END IF
Application.Terminate
END IF
ELSE
ShowMessage(FName$(11)+"\n\n                        This Speech file was Not Loaded")
Application.Terminate
END IF
ELSE
ShowMessage(FName$(11)+"\n\n                        This Speech file was Not Found")
Application.Terminate
END IF
ELSE
ShowMessage(DName$(LANG)+"\n\nThis Directory/Folder was Not Found")
Application.Terminate
END IF
END SUB

SUB SO_Change
IF SO=0 THEN
Canvas1.Rectangle (311, 457, 400, 487, &H000000)
Canvas1.FillRect (313, 459, 398, 485, &H00A0A0)
Canvas1.Line (312, 458, 398, 458, &H00C0C0)
Canvas1.Line (398, 459, 398, 485, &H00C0C0)
Canvas1.Line (312, 458, 312, 485, &H008080)
Canvas1.Line (313, 485, 398, 485, &H008080)
Canvas1.TextOut (308, 457, " SPEAK", &H007070, -1)
Canvas1.TextOut (308, 457, " S", &HFFFFFF, -1)
ELSE
Canvas1.Rectangle (311, 457, 400, 487, &H000000)
Canvas1.FillRect (313, 459, 398, 485, &H00B0D0)
Canvas1.Line (312, 458, 398, 458, &H00C0E0)
Canvas1.Line (398, 459, 398, 485, &H00C0E0)
Canvas1.Line (312, 458, 312, 485, &H00A0C0)
Canvas1.Line (313, 485, 398, 485, &H00A0C0)
Canvas1.TextOut (308, 457, " SPEAK", &H0080A0, -1)
END IF
END SUB

SUB SO_Check
IF SO=0 THEN
SO=1
ELSE
SO=0
END IF
SO_Change
END SUB

SUB PO_Change
IF PO=0 THEN
Canvas1.Rectangle (3, 457, 92, 487, &H000000)
Canvas1.FillRect (5, 459, 90, 485, &H00A0A0)
Canvas1.Line (4, 458, 90, 458, &H00C0C0)
Canvas1.Line (90, 459, 90, 485, &H00C0C0)
Canvas1.Line (4, 458, 4, 485, &H008080)
Canvas1.Line (5, 485, 90, 485, &H008080)
Canvas1.TextOut (0, 457, " PAUSE", &H007070, -1)
Canvas1.TextOut (0, 457, " P", &HFFFFFF, -1)
ELSE
Canvas1.Rectangle (3, 457, 92, 487, &H000000)
Canvas1.FillRect (5, 459, 90, 485, &H00B0D0)
Canvas1.Line (4, 458, 90, 458, &H00C0E0)
Canvas1.Line (90, 459, 90, 485, &H00C0E0)
Canvas1.Line (4, 458, 4, 485, &H00A0C0)
Canvas1.Line (5, 485, 90, 485, &H00A0C0)
Canvas1.TextOut (0, 457, " PAUSE", &H0080A0, -1)
END IF
END SUB

SUB PO_Check
PST=0 : PO=1 : PO_Change
IF STOPDELAY>0 THEN
SLEEP STOPDELAY : PO=0 : PO_Change
ELSE
PST=1 : AMT=1
END IF
END SUB

SUB MN_Change
IF MN=0 THEN
Canvas1.Rectangle (414, 457, 524, 487, &H000000)
Canvas1.FillRect (416, 459, 522, 485, &H00A0A0)
Canvas1.Line (415, 458, 522, 458, &H00C0C0)
Canvas1.Line (522, 459, 522, 485, &H00C0C0)
Canvas1.Line (415, 458, 415, 485, &H008080)
Canvas1.Line (416, 485, 522, 485, &H008080)
Canvas1.TextOut (411, 457, " MANUAL", &H007070, -1)
Canvas1.TextOut (411, 457, " M", &HFFFFFF, -1)
ELSE
Canvas1.Rectangle (414, 457, 524, 487, &H000000)
Canvas1.FillRect (416, 459, 522, 485, &H00B0D0)
Canvas1.Line (415, 458, 522, 458, &H00C0E0)
Canvas1.Line (522, 459, 522, 485, &H00C0E0)
Canvas1.Line (415, 458, 415, 485, &H00A0C0)
Canvas1.Line (416, 485, 522, 485, &H00A0C0)
Canvas1.TextOut (429, 457, " AUTO", &H0080A0, -1)
Canvas1.TextOut (429, 457, " A", &HFFFFFF, -1)
END IF
END SUB

SUB MN_Check
IF MN=0 THEN
MN=1
ELSE
MN=0
END IF
MN_Change
END SUB

SUB Auto_Mode
AMT=1 : IF LRN=0 THEN
Clear_Words : Next_Words
IF (DP=1 AND FP=1 AND DJ=1 AND FJ=1 AND DV=1 AND FV=1) THEN
IF AMDELAY>0 THEN SLEEP AMDELAY
SO_Check : Speak_ToMe : SO_Check
ELSEIF (DP=0 AND FP=0 AND DJ=0 AND FJ=0 AND DV=0 AND FV=0) THEN

ELSE
IF RVDELAY>0 THEN SLEEP RVDELAY
Reveal_Words : IF AMDELAY>0 THEN SLEEP AMDELAY
SO_Check : Speak_ToMe : SO_Check
END IF
ELSE
Clear_Sentences : Next_Sentences
IF (DS=1 AND FS=1) THEN
IF AMDELAY>0 THEN SLEEP AMDELAY
SO_Check : Speak_ToMe : SO_Check
ELSEIF (DS=0 AND FS=0) THEN

ELSE
IF RVDELAY>0 THEN SLEEP RVDELAY
Reveal_Sentences : IF AMDELAY>0 THEN SLEEP AMDELAY
SO_Check : Speak_ToMe : SO_Check
END IF
END IF
AMT=0
END SUB

SUB Auto_Timer
AutoTimer.Interval=3000 : IF (AMT=0 AND MN=1) THEN Auto_Mode
END SUB

SUB DS_Change
IF DS=1 THEN
Canvas1.Rectangle (16, 38, 43, 58, &H000000)
Canvas1.FillRect (18, 40, 41, 56, &H80E0F0)
Canvas1.Line (17, 39, 41, 39, &H90F0FF)
Canvas1.Line (41, 40, 41, 56, &H90F0FF)
Canvas1.Line (17, 39, 17, 56, &H70D0E0)
Canvas1.Line (17, 56, 41, 56, &H70D0E0)
ELSE
Canvas1.Rectangle (16, 38, 43, 58, &H000000)
Canvas1.FillRect (18, 40, 41, 56, &H98BCD0)
Canvas1.Line (17, 39, 41, 39, &HC0E4F8)
Canvas1.Line (41, 40, 41, 56, &HC0E4F8)
Canvas1.Line (17, 39, 17, 56, &H7094A8)
Canvas1.Line (17, 56, 41, 56, &H7094A8)
END IF
END SUB

SUB FS_Change
IF FS=1 THEN
Canvas1.Rectangle (16, 115, 43, 135, &H000000)
Canvas1.FillRect (18, 117, 41, 133, &H80E0F0)
Canvas1.Line (17, 116, 41, 116, &H90F0FF)
Canvas1.Line (41, 117, 41, 133, &H90F0FF)
Canvas1.Line (17, 116, 17, 133, &H70D0E0)
Canvas1.Line (17, 133, 41, 133, &H70D0E0)
ELSE
Canvas1.Rectangle (16, 115, 43, 135, &H000000)
Canvas1.FillRect (18, 117, 41, 133, &H98BCD0)
Canvas1.Line (17, 116, 41, 116, &HC0E4F8)
Canvas1.Line (41, 117, 41, 133, &HC0E4F8)
Canvas1.Line (17, 116, 17, 133, &H7094A8)
Canvas1.Line (17, 133, 41, 133, &H7094A8)
END IF
END SUB

SUB DP_Change
IF DP=1 THEN
Canvas1.Rectangle (16, 173, 43, 193, &H000000)
Canvas1.FillRect (18, 175, 41, 191, &H80E0F0)
Canvas1.Line (17, 174, 41, 174, &H90F0FF)
Canvas1.Line (41, 175, 41, 191, &H90F0FF)
Canvas1.Line (17, 174, 17, 191, &H70D0E0)
Canvas1.Line (17, 191, 41, 191, &H70D0E0)
ELSE
Canvas1.Rectangle (16, 173, 43, 193, &H000000)
Canvas1.FillRect (18, 175, 41, 191, &H98BCD0)
Canvas1.Line (17, 174, 41, 174, &HC0E4F8)
Canvas1.Line (41, 175, 41, 191, &HC0E4F8)
Canvas1.Line (17, 174, 17, 191, &H7094A8)
Canvas1.Line (17, 191, 41, 191, &H7094A8)
END IF
END SUB

SUB FP_Change
IF FP=1 THEN
Canvas1.Rectangle (16, 220, 43, 240, &H000000)
Canvas1.FillRect (18, 222, 41, 238, &H80E0F0)
Canvas1.Line (17, 221, 41, 221, &H90F0FF)
Canvas1.Line (41, 222, 41, 238, &H90F0FF)
Canvas1.Line (17, 221, 17, 238, &H70D0E0)
Canvas1.Line (17, 238, 41, 238, &H70D0E0)
ELSE
Canvas1.Rectangle (16, 220, 43, 240, &H000000)
Canvas1.FillRect (18, 222, 41, 238, &H98BCD0)
Canvas1.Line (17, 221, 41, 221, &HC0E4F8)
Canvas1.Line (41, 222, 41, 238, &HC0E4F8)
Canvas1.Line (17, 221, 17, 238, &H7094A8)
Canvas1.Line (17, 238, 41, 238, &H7094A8)
END IF
END SUB

SUB DJ_Change
IF DJ=1 THEN
Canvas1.Rectangle (16, 269, 43, 289, &H000000)
Canvas1.FillRect (18, 271, 41, 287, &H80E0F0)
Canvas1.Line (17, 270, 41, 270, &H90F0FF)
Canvas1.Line (41, 271, 41, 287, &H90F0FF)
Canvas1.Line (17, 270, 17, 287, &H70D0E0)
Canvas1.Line (17, 287, 41, 287, &H70D0E0)
ELSE
Canvas1.Rectangle (16, 269, 43, 289, &H000000)
Canvas1.FillRect (18, 271, 41, 287, &H98BCD0)
Canvas1.Line (17, 270, 41, 270, &HC0E4F8)
Canvas1.Line (41, 271, 41, 287, &HC0E4F8)
Canvas1.Line (17, 270, 17, 287, &H7094A8)
Canvas1.Line (17, 287, 41, 287, &H7094A8)
END IF
END SUB

SUB FJ_Change
IF FJ=1 THEN
Canvas1.Rectangle (16, 316, 43, 336, &H000000)
Canvas1.FillRect (18, 318, 41, 334, &H80E0F0)
Canvas1.Line (17, 317, 41, 317, &H90F0FF)
Canvas1.Line (41, 318, 41, 334, &H90F0FF)
Canvas1.Line (17, 317, 17, 334, &H70D0E0)
Canvas1.Line (17, 334, 41, 334, &H70D0E0)
ELSE
Canvas1.Rectangle (16, 316, 43, 336, &H000000)
Canvas1.FillRect (18, 318, 41, 334, &H98BCD0)
Canvas1.Line (17, 317, 41, 317, &HC0E4F8)
Canvas1.Line (41, 318, 41, 334, &HC0E4F8)
Canvas1.Line (17, 317, 17, 334, &H7094A8)
Canvas1.Line (17, 334, 41, 334, &H7094A8)
END IF
END SUB

SUB DV_Change
IF DV=1 THEN
Canvas1.Rectangle (16, 366, 43, 386, &H000000)
Canvas1.FillRect (18, 368, 41, 384, &H80E0F0)
Canvas1.Line (17, 367, 41, 367, &H90F0FF)
Canvas1.Line (41, 368, 41, 384, &H90F0FF)
Canvas1.Line (17, 367, 17, 384, &H70D0E0)
Canvas1.Line (17, 384, 41, 384, &H70D0E0)
ELSE
Canvas1.Rectangle (16, 366, 43, 386, &H000000)
Canvas1.FillRect (18, 368, 41, 384, &H98BCD0)
Canvas1.Line (17, 367, 41, 367, &HC0E4F8)
Canvas1.Line (41, 368, 41, 384, &HC0E4F8)
Canvas1.Line (17, 367, 17, 384, &H7094A8)
Canvas1.Line (17, 384, 41, 384, &H7094A8)
END IF
END SUB

SUB FV_Change
IF FV=1 THEN
Canvas1.Rectangle (16, 413, 43, 433, &H000000)
Canvas1.FillRect (18, 415, 41, 431, &H80E0F0)
Canvas1.Line (17, 414, 41, 414, &H90F0FF)
Canvas1.Line (41, 415, 41, 431, &H90F0FF)
Canvas1.Line (17, 414, 17, 431, &H70D0E0)
Canvas1.Line (17, 431, 41, 431, &H70D0E0)
ELSE
Canvas1.Rectangle (16, 413, 43, 433, &H000000)
Canvas1.FillRect (18, 415, 41, 431, &H98BCD0)
Canvas1.Line (17, 414, 41, 414, &HC0E4F8)
Canvas1.Line (41, 415, 41, 431, &HC0E4F8)
Canvas1.Line (17, 414, 17, 431, &H7094A8)
Canvas1.Line (17, 431, 41, 431, &H7094A8)
END IF
END SUB

SUB DS_Check
IF MN=0 THEN
IF DS=0 THEN
DS=1
ELSE
DS=0
END IF
DS_Change
END IF
END SUB

SUB FS_Check
IF MN=0 THEN
IF FS=0 THEN
FS=1
ELSE
FS=0
END IF
FS_Change
END IF
END SUB

SUB DP_Check
IF MN=0 THEN
IF DP=0 THEN
DP=1
ELSE
DP=0
END IF
DP_Change
END IF
END SUB

SUB FP_Check
IF MN=0 THEN
IF FP=0 THEN
FP=1
ELSE
FP=0
END IF
FP_Change
END IF
END SUB

SUB DJ_Check
IF MN=0 THEN
IF DJ=0 THEN
DJ=1
ELSE
DJ=0
END IF
DJ_Change
END IF
END SUB

SUB FJ_Check
IF MN=0 THEN
IF FJ=0 THEN
FJ=1
ELSE
FJ=0
END IF
FJ_Change
END IF
END SUB

SUB DV_Check
IF MN=0 THEN
IF DV=0 THEN
DV=1
ELSE
DV=0
END IF
DV_Change
END IF
END SUB

SUB FV_Check
IF MN=0 THEN
IF FV=0 THEN
FV=1
ELSE
FV=0
END IF
FV_Change
END IF
END SUB

SUB CP_Change
IF (OLDCP>=0 AND OLDCP<11) THEN
Canvas3.Rectangle (14, (OLDCP*40)+12, 333, (OLDCP*40)+43, &H98BCD0)
Canvas3.Rectangle (15, (OLDCP*40)+13, 332, (OLDCP*40)+42, &H98BCD0)
Canvas3.Rectangle (348, (OLDCP*40)+12, 382, (OLDCP*40)+43, &H98BCD0)
Canvas3.Rectangle (349, (OLDCP*40)+13, 381, (OLDCP*40)+42, &H98BCD0)
ELSEIF (OLDCP>10 AND OLDCP<22) THEN
Canvas3.Rectangle (411, ((OLDCP-11)*40)+12, 730, ((OLDCP-11)*40)+43, &H98BCD0)
Canvas3.Rectangle (412, ((OLDCP-11)*40)+13, 729, ((OLDCP-11)*40)+42, &H98BCD0)
Canvas3.Rectangle (745, ((OLDCP-11)*40)+12, 779, ((OLDCP-11)*40)+43, &H98BCD0)
Canvas3.Rectangle (746, ((OLDCP-11)*40)+13, 778, ((OLDCP-11)*40)+42, &H98BCD0)
END IF
IF (CURCP>=0 AND CURCP<11) THEN
Canvas3.Rectangle (14, (CURCP*40)+12, 333, (CURCP*40)+43, &H000000)
Canvas3.Rectangle (15, (CURCP*40)+13, 332, (CURCP*40)+42, &H000000)
Canvas3.Rectangle (348, (CURCP*40)+12, 382, (CURCP*40)+43, &H000000)
Canvas3.Rectangle (349, (CURCP*40)+13, 381, (CURCP*40)+42, &H000000)
ELSEIF (CURCP>10 AND CURCP<22) THEN
Canvas3.Rectangle (411, ((CURCP-11)*40)+12, 730, ((CURCP-11)*40)+43, &H000000)
Canvas3.Rectangle (412, ((CURCP-11)*40)+13, 729, ((CURCP-11)*40)+42, &H000000)
Canvas3.Rectangle (745, ((CURCP-11)*40)+12, 779, ((CURCP-11)*40)+43, &H000000)
Canvas3.Rectangle (746, ((CURCP-11)*40)+13, 778, ((CURCP-11)*40)+42, &H000000)
END IF
END SUB

SUB CP_Check
OLDCP=CURCP : CURCP=CPVAL : IF CURCP<>OLDCP THEN
CP_Change
IF LRN=0 THEN
CURSEQ=ALen(CURCP+44)
ELSE
CURSEQ=ALen(CURCP)
END IF
NEXTSEQ=CURSEQ
END IF
IF LRN=0 THEN
OLDPAA=10 : CURPAA=1
ELSE
OLDPAA=10 : CURPAA=0
END IF
END SUB

SUB DT_Check
IF OLDDT<>CURDT THEN
YY=15 : IF CURDT=0 THEN
FOR Z=0 TO 10 : WCats(Z).Caption=DTitles(Z) : WCats(Z+11).Caption=DTitles(Z+11) : INC (YY,40) : NEXT
ELSEIF CURDT=1 THEN
FOR Z=0 TO 10 : WCats(Z).Caption=DTitles(Z+22) : WCats(Z+11).Caption=DTitles(Z+33) : INC (YY,40) : NEXT
ELSEIF CURDT=2 THEN
FOR Z=0 TO 10 : WCats(Z).Caption=FTitles(Z) : WCats(Z+11).Caption=FTitles(Z+11) : INC (YY,40) : NEXT
ELSEIF CURDT=3 THEN
FOR Z=0 TO 10 : WCats(Z).Caption=FTitles(Z+22) : WCats(Z+11).Caption=FTitles(Z+33) : INC (YY,40) : NEXT
END IF
OLDDT=CURDT
END IF
IF LRN=0 THEN
CURSEQ=ALen(CURCP+44)
ELSE
CURSEQ=ALen(CURCP)
END IF
NEXTSEQ=CURSEQ
END SUB

SUB MouseClose2 (Button AS BYTE, X AS WORD, Y AS WORD, Shift AS INTEGER)
IF (Button=0 AND Shift=0) THEN
IF ((X>113 AND X<184) AND (Y>234 AND Y<263)) THEN
Window2.Close
ELSE

END IF
END IF
END SUB

SUB KeyClose2 (Key AS WORD, Shift AS INTEGER)
IF Shift=0 AND Key=89 THEN
Window2.Close
ELSE

END IF
END SUB

SUB Canvas1Redraw (Sender AS QCANVAS)
Sender.FillRect (793, 0, 800, 600, &H000000)
Sender.FillRect (0, 490, 800, 600, &H000000)
Sender.Rectangle (3, 3, 790, 453, &H000000)
Sender.FillRect (5, 5, 788, 451, &H98BCD0)
Sender.Line (4, 4, 788, 4, &HC0E4F8)
Sender.Line (788, 5, 788, 451, &HC0E4F8)
Sender.Line (4, 4, 4, 451, &H7094A8)
Sender.Line (5, 451, 788, 451, &H7094A8)
Sender.FillRect (210, 15, 778, 76, &HA8CCE0)
Sender.Line (209, 14, 778, 14, &HC7EBFF)
Sender.Line (778, 15, 778, 76, &HC7EBFF)
Sender.Line (209, 14, 209, 76, &H88ACC0)
Sender.Line (209, 76, 778, 76, &H88ACC0)
Sender.FillRect (210, 92, 778, 153, &HA8CCE0)
Sender.Line (209, 91, 778, 91, &HC7EBFF)
Sender.Line (778, 92, 778, 153, &HC7EBFF)
Sender.Line (209, 91, 209, 153, &H88ACC0)
Sender.Line (209, 153, 778, 153, &H88ACC0)
YY=169 : FOR Z=1 TO 6
Sender.FillRect (210, YY, 778, YY+32, &HA8CCE0)
Sender.Line (209, YY-1, 778, YY-1, &HC7EBFF)
Sender.Line (778, YY, 778, YY+32, &HC7EBFF)
Sender.Line (209, YY-1, 209, YY+32, &H88ACC0)
Sender.Line (209, YY+32, 778, YY+32, &H88ACC0)
INC (YY,48) : NEXT
DS_Change
FS_Change
DP_Change
FP_Change
DJ_Change
FJ_Change
DJ_Change
FJ_Change
DV_Change
FV_Change
PO_Change
Sender.Rectangle (106, 457, 209, 487, &H000000)
Sender.FillRect (108, 459, 207, 485, &H00A0A0)
Sender.Line (107, 458, 207, 458, &H00C0C0)
Sender.Line (207, 459, 207, 485, &H00C0C0)
Sender.Line (107, 458, 107, 485, &H008080)
Sender.Line (108, 485, 207, 485, &H008080)
Sender.Rectangle (223, 457, 297, 487, &H000000)
Sender.FillRect (225, 459, 295, 485, &H00A0A0)
Sender.Line (224, 458, 295, 458, &H00C0C0)
Sender.Line (295, 459, 295, 485, &H00C0C0)
Sender.Line (224, 458, 224, 485, &H008080)
Sender.Line (225, 485, 295, 485, &H008080)
SO_Change
MN_Change
Sender.Rectangle (538, 457, 657, 487, &H000000)
Sender.FillRect (540, 459, 655, 485, &H00A0A0)
Sender.Line (539, 458, 655, 458, &H00C0C0)
Sender.Line (655, 459, 655, 485, &H00C0C0)
Sender.Line (539, 458, 539, 485, &H008080)
Sender.Line (540, 485, 655, 485, &H008080)
Sender.Rectangle (671, 457, 697, 487, &H000000)
Sender.FillRect (673, 459, 695, 485, &H00A0A0)
Sender.Line (672, 458, 695, 458, &H00C0C0)
Sender.Line (695, 459, 695, 485, &H00C0C0)
Sender.Line (672, 458, 672, 485, &H008080)
Sender.Line (673, 485, 695, 485, &H008080)
Sender.Rectangle (711, 457, 737, 487, &H000000)
Sender.FillRect (713, 459, 735, 485, &H00A0A0)
Sender.Line (712, 458, 735, 458, &H00C0C0)
Sender.Line (735, 459, 735, 485, &H00C0C0)
Sender.Line (712, 458, 712, 485, &H008080)
Sender.Line (713, 485, 735, 485, &H008080)
Sender.Rectangle (751, 457, 774, 487, &H000000)
Sender.FillRect (753, 459, 772, 485, &H00A0A0)
Sender.Line (752, 458, 772, 458, &H00C0C0)
Sender.Line (772, 459, 772, 485, &H00C0C0)
Sender.Line (752, 458, 752, 485, &H008080)
Sender.Line (753, 485, 772, 485, &H008080)
Sender.Rectangle (780, 457, 790, 487, &H000000)
Sender.FillRect (782, 459, 788, 485, &H00A0A0)
Sender.Line (781, 458, 788, 458, &H00C0C0)
Sender.Line (788, 459, 788, 485, &H00C0C0)
Sender.Line (781, 458, 781, 485, &H008080)
Sender.Line (782, 485, 788, 485, &H008080)
Sender.TextOut (103, 457, " REVEAL ", &H007070, -1)
Sender.TextOut (103, 457, " R", &HFFFFFF, -1)
Sender.TextOut (220, 457, " NEXT ", &H007070, -1)
Sender.TextOut (220, 457, " N", &HFFFFFF, -1)
Sender.TextOut (536, 457, " OPTIONS ", &H007070, -1)
Sender.TextOut (536, 457, " O", &HFFFFFF, -1)
Sender.TextOut (756, 457, "?", &HFFFFFF, -1)
Sender.FillRect (680, 465, 688, 481, &HFFFFFF)
Sender.FillRect (720, 463, 728, 479, &HFFFFFF)
YY=0 : FOR Z=0 TO 7
Sender.Line (676+YY, 469-YY, 676+YY, 469, &HFFFFFF)
Sender.Line (691-YY, 469-YY, 691-YY, 469, &HFFFFFF)
Sender.Line (716+YY, 474, 716+YY, 474+YY, &HFFFFFF)
Sender.Line (731-YY, 474, 731-YY, 474+YY, &HFFFFFF)
INC YY : NEXT

IF CURDT>1 THEN
Label1.Caption="Sentences"
Label24.Caption=""
Label2.Caption="Pro/Nouns"
Label21.Caption=""
Label3.Caption="Adjectives"
Label22.Caption=""
Label4.Caption="Ad/Verbs"
Label23.Caption=""
ELSE
Label1.Caption=""
Label24.Caption="Mga Pangungusap"
Label2.Caption=""
Label21.Caption="Mga Pangngalan"
Label3.Caption=""
Label22.Caption="Mga Pang-Uri"
Label4.Caption=""
Label23.Caption="Mga Pandiwa"
END IF
END SUB

SUB Canvas2Redraw (Sender AS QCANVAS)
Sender.FillRect (3, 3, 296, 270, &HB8CCD8)
Sender.Line (2, 2, 296, 2, &HD8ECF8)
Sender.Line (296, 3, 296, 270, &HD8ECF8)
Sender.Line (2, 2, 2, 270, &H889CB8)
Sender.Line (3, 270, 296, 270, &H889CB8)
Sender.TextOut (66, 40, "John White", &HFFFFFF, -1)
Sender.TextOut (66, 64, "91 Comber House", &HFFFFFF, -1)
Sender.TextOut (66, 88, "Comber Grove", &HFFFFFF, -1)
Sender.TextOut (66, 112, "Camberwell", &HFFFFFF, -1)
Sender.TextOut (66, 136, "London SE5 0LL", &HFFFFFF, -1)
Sender.TextOut (66, 160, "ENGLAND", &HFFFFFF, -1)
Sender.Line (3, 225, 296, 225, &H889CB8)
Sender.Line (2, 226, 296, 226, &H000000)
Sender.Line (3, 227, 296, 227, &HD8ECF8)
Sender.Rectangle (114, 235, 184, 263, &H000000)
Sender.FillRect (116, 237, 182, 261, &H00A0A0)
Sender.Line (115, 236, 182, 236, &H00C0C0)
Sender.Line (182, 237, 182, 261, &H00C0C0)
Sender.Line (115, 236, 115, 261, &H008080)
Sender.Line (116, 261, 182, 261, &H008080)
Sender.TextOut (122, 237, "OKAY", &H007070, -1)
Sender.TextOut (163, 237, "Y", &HFFFFFF, -1)
END SUB

SUB Canvas3Redraw (Sender AS QCANVAS)
Sender.FillRect (793, 0, 800, 600, &H000000)
Sender.FillRect (0, 490, 800, 600, &H000000)
Sender.Rectangle (3, 3, 790, 453, &H000000)
Sender.FillRect (5, 5, 788, 451, &H98BCD0)
Sender.Line (4, 4, 788, 4, &HC0E4F8)
Sender.Line (788, 5, 788, 451, &HC0E4F8)
Sender.Line (4, 4, 4, 451, &H7094A8)
Sender.Line (5, 451, 788, 451, &H7094A8)
YY=15 : FOR Z=0 TO 10
Sender.FillRect (17, YY, 379, YY+25, &HA8CCE0)
Sender.Line (16, YY-1, 379, YY-1, &HC8ECFF)
Sender.Line (379, YY, 379, YY+25, &HC8ECFF)
Sender.Line (16, YY-1, 16, YY+25, &H88ACC0)
Sender.Line (17, YY+25, 379, YY+25, &H88ACC0)
Sender.Line (330, YY, 330, YY+24, &HC8ECFF)
Sender.FillRect (331, YY-1, 350, YY+26, &H98BCD0)
Sender.Line (350, YY-1, 350, YY+25, &H88ACC0)
Sender.FillRect (414, YY, 776, YY+25, &HA8CCE0)
Sender.Line (413, YY-1, 776, YY-1, &HC8ECFF)
Sender.Line (776, YY, 776, YY+25, &HC8ECFF)
Sender.Line (413, YY-1, 413, YY+25, &H88ACC0)
Sender.Line (414, YY+25, 776, YY+25, &H88ACC0)
Sender.Line (727, YY, 727, YY+24, &HC8ECFF)
Sender.FillRect (728, YY-1, 747, YY+26, &H98BCD0)
Sender.Line (747, YY-1, 747, YY+25, &H88ACC0)
INC (YY,40) : NEXT
CP_Change
Sender.Rectangle (3, 457, 109, 487, &H000000)
Sender.FillRect (5, 459, 107, 485, &H00A0A0)
Sender.Line (4, 458, 107, 458, &H00C0C0)
Sender.Line (107, 459, 107, 485, &H00C0C0)
Sender.Line (4, 458, 4, 485, &H008080)
Sender.Line (5, 485, 107, 485, &H008080)
Sender.Rectangle (123, 457, 254, 487, &H000000)
Sender.FillRect (125, 459, 252, 485, &H00A0A0)
Sender.Line (124, 458, 252, 458, &H00C0C0)
Sender.Line (252, 459, 252, 485, &H00C0C0)
Sender.Line (124, 458, 124, 485, &H008080)
Sender.Line (125, 485, 252, 485, &H008080)
Sender.Rectangle (268, 457, 371, 487, &H000000)
Sender.FillRect (270, 459, 369, 485, &H00A0A0)
Sender.Line (269, 458, 369, 458, &H00C0C0)
Sender.Line (369, 459, 369, 485, &H00C0C0)
Sender.Line (269, 458, 269, 485, &H008080)
Sender.Line (270, 485, 369, 485, &H008080)
Sender.Rectangle (385, 457, 537, 487, &H000000)
Sender.FillRect (387, 459, 535, 485, &H00A0A0)
Sender.Line (386, 458, 535, 458, &H00C0C0)
Sender.Line (535, 459, 535, 485, &H00C0C0)
Sender.Line (386, 458, 386, 485, &H008080)
Sender.Line (387, 485, 535, 485, &H008080)
Sender.Rectangle (551, 457, 709, 487, &H000000)
Sender.FillRect (553, 459, 707, 485, &H00A0A0)
Sender.Line (552, 458, 707, 458, &H00C0C0)
Sender.Line (707, 459, 707, 485, &H00C0C0)
Sender.Line (552, 458, 552, 485, &H008080)
Sender.Line (553, 485, 707, 485, &H008080)
Sender.Rectangle (723, 457, 790, 487, &H000000)
Sender.FillRect (725, 459, 788, 485, &H00A0A0)
Sender.Line (724, 458, 788, 458, &H00C0C0)
Sender.Line (788, 459, 788, 485, &H00C0C0)
Sender.Line (724, 458, 724, 485, &H008080)
Sender.Line (725, 485, 788, 485, &H008080)
Sender.TextOut (0, 457, " SEARCH", &H007070, -1)
Sender.TextOut (0, 457, " S", &HFFFFFF, -1)
Sender.TextOut (120, 457, " SETTINGS", &H007070, -1)
Sender.TextOut (189, 457, " N", &HFFFFFF, -1)
Sender.TextOut (266, 457, " WORDS", &H007070, -1)
Sender.TextOut (266, 457, " W", &HFFFFFF, -1)
Sender.TextOut (382, 457, " SENTENCES", &H007070, -1)
Sender.TextOut (430, 457, " T", &HFFFFFF, -1)
Sender.TextOut (720, 457, " EXIT", &H007070, -1)
Sender.TextOut (720, 457, " E", &HFFFFFF, -1)
END SUB

SUB DF_Change
IF CURDF=0 THEN
Canvas4.Rectangle (18, 62, 171, 92, &H30A0E0)
Canvas4.Rectangle (17, 61, 172, 93, &H30A0E0)
Canvas4.Rectangle (18, 18, 171, 48, &H000000)
Canvas4.Rectangle (17, 17, 172, 49, &H000000)
ELSE
Canvas4.Rectangle (18, 18, 171, 48, &H30A0E0)
Canvas4.Rectangle (17, 17, 172, 49, &H30A0E0)
Canvas4.Rectangle (18, 62, 171, 92, &H000000)
Canvas4.Rectangle (17, 61, 172, 93, &H000000)
END IF
END SUB

SUB DF_Check
IF CURDF<>OLDDF THEN
DF_Change
OLDDF=CURDF
END IF
END SUB

SUB PAA_Change
IF CURPAA=1 THEN
Canvas4.Rectangle (18, 124, 171, 154, &H30A0E0)
Canvas4.Rectangle (17, 123, 172, 155, &H30A0E0)
Canvas4.Rectangle (18, 212, 171, 242, &H30A0E0)
Canvas4.Rectangle (17, 211, 172, 243, &H30A0E0)
Canvas4.Rectangle (18, 256, 171, 286, &H30A0E0)
Canvas4.Rectangle (17, 255, 172, 287, &H30A0E0)
Canvas4.Rectangle (18, 168, 171, 198, &H000000)
Canvas4.Rectangle (17, 167, 172, 199, &H000000)
ELSEIF CURPAA=2 THEN
Canvas4.Rectangle (18, 124, 171, 154, &H30A0E0)
Canvas4.Rectangle (17, 123, 172, 155, &H30A0E0)
Canvas4.Rectangle (18, 168, 171, 198, &H30A0E0)
Canvas4.Rectangle (17, 167, 172, 199, &H30A0E0)
Canvas4.Rectangle (18, 256, 171, 286, &H30A0E0)
Canvas4.Rectangle (17, 255, 172, 287, &H30A0E0)
Canvas4.Rectangle (18, 212, 171, 242, &H000000)
Canvas4.Rectangle (17, 211, 172, 243, &H000000)
ELSEIF CURPAA=3 THEN
Canvas4.Rectangle (18, 124, 171, 154, &H30A0E0)
Canvas4.Rectangle (17, 123, 172, 155, &H30A0E0)
Canvas4.Rectangle (18, 168, 171, 198, &H30A0E0)
Canvas4.Rectangle (17, 167, 172, 199, &H30A0E0)
Canvas4.Rectangle (18, 212, 171, 242, &H30A0E0)
Canvas4.Rectangle (17, 211, 172, 243, &H30A0E0)
Canvas4.Rectangle (18, 256, 171, 286, &H000000)
Canvas4.Rectangle (17, 255, 172, 287, &H000000)
ELSE
Canvas4.Rectangle (18, 168, 171, 198, &H30A0E0)
Canvas4.Rectangle (17, 167, 172, 199, &H30A0E0)
Canvas4.Rectangle (18, 212, 171, 242, &H30A0E0)
Canvas4.Rectangle (17, 211, 172, 243, &H30A0E0)
Canvas4.Rectangle (18, 256, 171, 286, &H30A0E0)
Canvas4.Rectangle (17, 255, 172, 287, &H30A0E0)
Canvas4.Rectangle (18, 124, 171, 154, &H000000)
Canvas4.Rectangle (17, 123, 172, 155, &H000000)
END IF
END SUB

SUB PAA_Check
IF CURPAA<>OLDPAA THEN
PAA_Change : OLDPAA=CURPAA
END IF
END SUB

SUB Canvas4Redraw (Sender AS QCANVAS)
Sender.Rectangle (3, 3, 778, 301, &H000000)
Sender.FillRect (5, 5, 776, 299, &H30A0E0)
Sender.Line (4, 4, 776, 4, &H50C0FF)
Sender.Line (776, 5, 776, 299, &H50C0FF)
Sender.Line (4, 4, 4, 299, &H1080C0)
Sender.Line (5, 299, 776, 299, &H1080C0)
Sender.Line (184, 5, 184, 298, &H50C0FF)
Sender.Line (185, 4, 185, 300, &H000000)
Sender.FillRect (186, 3, 196, 301, &H98BCD0)
Sender.Line (196, 4, 196, 300, &H000000)
Sender.Line (197, 5, 197, 299, &H1080C0)
YY=18 : FOR Z=0 TO 5
Sender.FillRect (20, YY+2, 169, YY+28, &H60B0E0)
Sender.Line (19, YY+1, 169, YY+1, &H80D0FF)
Sender.Line (169, YY+2, 169, YY+28, &H80D0FF)
Sender.Line (19, YY+1, 19, YY+28, &H4090C0)
Sender.Line (20, YY+28, 169, YY+28, &H4090C0)
IF Z=1 THEN YY=80
INC (YY,44) : NEXT
Sender.FillRect (331, 24, 761, 49, &H504030)
Sender.Line (330, 23, 761, 23, &H1080C0)
Sender.Line (761, 24, 761, 49, &H1080C0)
Sender.Line (330, 22, 762, 22, &H1080C0)
Sender.Line (762, 23, 762, 50, &H1080C0)
Sender.Line (330, 23, 330, 49, &H50C0FF)
Sender.Line (331, 49, 760, 49, &H50C0FF)
Sender.Line (329, 22, 329, 50, &H50C0FF)
Sender.Line (330, 50, 761, 50, &H50C0FF)
Sender.FillRect (330, 71, 762, 102, &H60B0E0)
Sender.Line (329, 70, 762, 70, &H80D0FF)
Sender.Line (762, 71, 762, 102, &H80D0FF)
Sender.Line (329, 70, 329, 102, &H4090C0)
Sender.Line (330, 102, 762, 102, &H4090C0)
Sender.Rectangle (329, 122, 464, 152, &H000000)
Sender.FillRect (331, 124, 462, 150, &H60B0E0)
Sender.Line (330, 123, 462, 123, &H80D0FF)
Sender.Line (462, 124, 462, 150, &H80D0FF)
Sender.Line (330, 123, 330, 150, &H4090C0)
Sender.Line (331, 150, 462, 150, &H4090C0)
Sender.FillRect (211, 171, 762, 287, &H60B0E0)
Sender.Line (210, 171, 762, 171, &H80D0FF)
Sender.Line (762, 171, 762, 287, &H80D0FF)
Sender.Line (210, 171, 210, 287, &H4090C0)
Sender.Line (211, 287, 762, 287, &H4090C0)
Sender.Rectangle (696, 122, 763, 152, &H000000)
Sender.FillRect (698, 124, 761, 150, &H3090E0)
Sender.Line (697, 123, 761, 123, &H50B0FF)
Sender.Line (761, 124, 761, 150, &H50B0FF)
Sender.Line (697, 123, 697, 150, &H1070C0)
Sender.Line (698, 150, 761, 150, &H1070C0)
Sender.TextOut (701, 122, "EXIT", &H004090, -1)
Sender.TextOut (701, 122, "E", &HFFFFFF, -1)
Sender.TextOut (41, 18, "DEFAULT", &H106090, -1)
Sender.TextOut (41, 18, "D", &HFFFFFF, -1)
Sender.TextOut (41, 62, "FOREIGN", &H106090, -1)
Sender.TextOut (41, 62, "F", &HFFFFFF, -1)
Sender.TextOut (31, 124, "SENTENCE", &H106090, -1)
Sender.TextOut (62, 124, "N", &HFFFFFF, -1)
Sender.TextOut (31, 168, "PRO/NOUN", &H106090, -1)
Sender.TextOut (124, 168, "U", &HFFFFFF, -1)
Sender.TextOut (30, 213, "ADJECTIVE", &H106090, -1)
Sender.TextOut (64, 213, "J", &HFFFFFF, -1)
Sender.TextOut (41, 256, "AD/VERB", &H106090, -1)
Sender.TextOut (116, 256, "R", &HFFFFFF, -1)
Sender.TextOut (335, 122, "CONTINUE", &H106090, -1)
Sender.TextOut (335, 122, "C", &HFFFFFF, -1)
DF_Change : PAA_Check
END SUB

SUB SPLIT_Change
Canvas5.FillRect (421, 19, 474, 47, &HE0C0A0)
IF SPLIT=0 THEN
Canvas5.TextOut (425, 18, "OFF", &HB09070, -1)
ELSE
Canvas5.TextOut (430, 18, "ON ", &HB09070, -1)
END IF
END SUB

SUB SPELL_Change
Canvas5.FillRect (421, 69, 474, 97, &HE0C0A0)
IF SPELL=0 THEN
Canvas5.TextOut (425, 68, "OFF", &HB09070, -1)
ELSE
Canvas5.TextOut (430, 68, "ON ", &HB09070, -1)
END IF
END SUB

SUB SPEECH_Change
Canvas5.FillRect (421, 119, 474, 147, &HE0C0A0)
IF SPEECH=0 THEN
Canvas5.TextOut (425, 118, "OFF", &HB09070, -1)
ELSE
Canvas5.TextOut (430, 118, "ON ", &HB09070, -1)
END IF
END SUB

SUB SEQRND_Change
Canvas5.FillRect (421, 169, 474, 197, &HE0C0A0)
IF SEQRND=0 THEN
Canvas5.TextOut (425, 168, "OFF", &HB09070, -1)
ELSE
Canvas5.TextOut (430, 168, "ON ", &HB09070, -1)
END IF
END SUB

SUB MISC_Change
Canvas5.FillRect (421, 219, 474, 247, &HE0C0A0)
IF MISC=0 THEN
Canvas5.TextOut (425, 218, "OFF", &HB09070, -1)
ELSE
Canvas5.TextOut (430, 218, "ON ", &HB09070, -1)
END IF
END SUB

SUB DRIVE_Change
Canvas5.FillRect (692, 20, 743, 46, &HE0C0A0)
Canvas5.TextOut (698, 18, Left$(drive$(Drv_Cnt), 3), &HB09070, -1)
END SUB

SUB DWAV_Change
Canvas5.FillRect (692, 70, 753, 96, &HE0C0A0)
IF DWAV=1 THEN
Canvas5.TextOut (698, 68, "ENG", &HB09070, -1)
ELSEIF DWAV=2 THEN
Canvas5.TextOut (698, 68, "FRE", &HB09070, -1)
ELSEIF DWAV=3 THEN
Canvas5.TextOut (698, 68, "GER", &HB09070, -1)
ELSEIF DWAV=4 THEN
Canvas5.TextOut (698, 68, "IND", &HB09070, -1)
ELSEIF DWAV=5 THEN
Canvas5.TextOut (698, 68, "ITA", &HB09070, -1)
ELSEIF DWAV=6 THEN
Canvas5.TextOut (698, 68, "KOR", &HB09070, -1)
ELSEIF DWAV=7 THEN
Canvas5.TextOut (698, 68, "NOR", &HB09070, -1)
ELSEIF DWAV=8 THEN
Canvas5.TextOut (696, 68, "SWE", &HB09070, -1)
ELSEIF DWAV=9 THEN
Canvas5.TextOut (698, 68, "SPA", &HB09070, -1)
ELSEIF DWAV=10 THEN
Canvas5.TextOut (698, 68, "TAG", &HB09070, -1)
END IF
END SUB

SUB FWAV_Change
Canvas5.FillRect (692, 120, 753, 146, &HE0C0A0)
IF FWAV=1 THEN
Canvas5.TextOut (698, 118, "ENG", &HB09070, -1)
ELSEIF FWAV=2 THEN
Canvas5.TextOut (698, 118, "FRE", &HB09070, -1)
ELSEIF FWAV=3 THEN
Canvas5.TextOut (698, 118, "GER", &HB09070, -1)
ELSEIF FWAV=4 THEN
Canvas5.TextOut (698, 118, "IND", &HB09070, -1)
ELSEIF FWAV=5 THEN
Canvas5.TextOut (698, 118, "ITA", &HB09070, -1)
ELSEIF FWAV=6 THEN
Canvas5.TextOut (698, 118, "KOR", &HB09070, -1)
ELSEIF FWAV=7 THEN
Canvas5.TextOut (698, 118, "NOR", &HB09070, -1)
ELSEIF FWAV=8 THEN
Canvas5.TextOut (696, 118, "SWE", &HB09070, -1)
ELSEIF FWAV=9 THEN
Canvas5.TextOut (698, 118, "SPA", &HB09070, -1)
ELSEIF FWAV=10 THEN
Canvas5.TextOut (698, 118, "TAG", &HB09070, -1)
END IF
END SUB

SUB DSFILE_Change
Canvas5.FillRect (692, 170, 753, 196, &HE0C0A0)
IF DSFILE=1 THEN
Canvas5.TextOut (698, 168, "ENG", &HB09070, -1)
ELSEIF DSFILE=2 THEN
Canvas5.TextOut (698, 168, "FRE", &HB09070, -1)
ELSEIF DSFILE=3 THEN
Canvas5.TextOut (698, 168, "GER", &HB09070, -1)
ELSEIF DSFILE=4 THEN
Canvas5.TextOut (698, 168, "IND", &HB09070, -1)
ELSEIF DSFILE=5 THEN
Canvas5.TextOut (698, 168, "ITA", &HB09070, -1)
ELSEIF DSFILE=6 THEN
Canvas5.TextOut (698, 168, "KOR", &HB09070, -1)
ELSEIF DSFILE=7 THEN
Canvas5.TextOut (698, 168, "NOR", &HB09070, -1)
ELSEIF DSFILE=8 THEN
Canvas5.TextOut (696, 168, "SWE", &HB09070, -1)
ELSEIF DSFILE=9 THEN
Canvas5.TextOut (698, 168, "SPA", &HB09070, -1)
ELSEIF DSFILE=10 THEN
Canvas5.TextOut (698, 168, "TAG", &HB09070, -1)
END IF
END SUB

SUB FSFILE_Change
Canvas5.FillRect (692, 220, 753, 246, &HE0C0A0)
IF FSFILE=1 THEN
Canvas5.TextOut (698, 218, "ENG", &HB09070, -1)
ELSEIF FSFILE=2 THEN
Canvas5.TextOut (698, 218, "FRE", &HB09070, -1)
ELSEIF FSFILE=3 THEN
Canvas5.TextOut (698, 218, "GER", &HB09070, -1)
ELSEIF FSFILE=4 THEN
Canvas5.TextOut (698, 218, "IND", &HB09070, -1)
ELSEIF FSFILE=5 THEN
Canvas5.TextOut (698, 218, "ITA", &HB09070, -1)
ELSEIF FSFILE=6 THEN
Canvas5.TextOut (698, 218, "KOR", &HB09070, -1)
ELSEIF FSFILE=7 THEN
Canvas5.TextOut (698, 218, "NOR", &HB09070, -1)
ELSEIF FSFILE=8 THEN
Canvas5.TextOut (696, 218, "SWE", &HB09070, -1)
ELSEIF FSFILE=9 THEN
Canvas5.TextOut (698, 218, "SPA", &HB09070, -1)
ELSEIF FSFILE=10 THEN
Canvas5.TextOut (698, 218, "TAG", &HB09070, -1)
END IF
END SUB

SUB LANG_Change
Canvas5.FillRect (421, 270, 594, 296, &HE0C0A0)
IF LANG=1 THEN
Canvas5.TextOut (429, 268, "ENGLISH", &HB09070, -1)
ELSEIF LANG=2 THEN
Canvas5.TextOut (429, 268, "FRENCH", &HB09070, -1)
ELSEIF LANG=3 THEN
Canvas5.TextOut (429, 268, "GERMAN", &HB09070, -1)
ELSEIF LANG=4 THEN
Canvas5.TextOut (429, 268, "INDONESIAN", &HB09070, -1)
ELSEIF LANG=5 THEN
Canvas5.TextOut (429, 268, "ITALIAN", &HB09070, -1)
ELSEIF LANG=6 THEN
Canvas5.TextOut (429, 268, "KOREAN", &HB09070, -1)
ELSEIF LANG=7 THEN
Canvas5.TextOut (429, 268, "NORWEGIAN", &HB09070, -1)
ELSEIF LANG=8 THEN
Canvas5.TextOut (429, 268, "SWEDISH", &HB09070, -1)
ELSEIF LANG=9 THEN
Canvas5.TextOut (429, 268, "SPANISH", &HB09070, -1)
ELSEIF LANG=10 THEN
Canvas5.TextOut (429, 268, "TAGALOG", &HB09070, -1)
END IF
END SUB

SUB SPLIT_Check
INC SPLIT : IF SPLIT>1 THEN SPLIT=0
SPLIT_Change
END SUB

SUB SPELL_Check
INC SPELL : IF SPELL>1 THEN SPELL=0
SPELL_Change
END SUB

SUB SPEECH_Check
INC SPEECH : IF SPEECH>1 THEN SPEECH=0
SPEECH_Change
END SUB

SUB SEQRND_Check
INC SEQRND : IF SEQRND>1 THEN SEQRND=0
SEQRND_Change
END SUB

SUB MISC_Check
INC MISC : IF MISC>1 THEN MISC=0
MISC_Change
IF MISC=1 THEN
ALen(21)=0 : ALen(65)=0 : CURSEQ=0 : NEXTSEQ=CURSEQ
CLen(21)=Totals(2) : CLen(65)=Totals(4)
ELSE
IF LRN=0 THEN
ALen(65)=MISCEND : CURSEQ=MISCEND : NEXTSEQ=CURSEQ : CLen(65)=MISCLEN
ELSE
ALen(21)=MISCSTART : CURSEQ=MISCSTART : NEXTSEQ=CURSEQ : CLen(21)=MISCTOT
END IF
END IF
END SUB

SUB FSFILE_Dec
DEC FSFILE : IF FSFILE<1 THEN FSFILE=10
FSFILE_Change
END SUB

SUB FSFILE_Inc
INC FSFILE : IF FSFILE>10 THEN FSFILE=1
FSFILE_Change
END SUB

SUB DSFILE_Dec
DEC DSFILE : IF DSFILE<1 THEN DSFILE=10
DSFILE_Change
END SUB

SUB DSFILE_Inc
INC DSFILE : IF DSFILE>10 THEN DSFILE=1
DSFILE_Change
END SUB

SUB FWAV_Dec
DEC FWAV : IF FWAV<1 THEN FWAV=10
FWAV_Change
END SUB

SUB FWAV_Inc
INC FWAV : IF FWAV>10 THEN FWAV=1
FWAV_Change
END SUB

SUB DWAV_Dec
DEC DWAV : IF DWAV<1 THEN DWAV=10
DWAV_Change
END SUB

SUB DWAV_Inc
INC DWAV : IF DWAV>10 THEN DWAV=1
DWAV_Change
END SUB

SUB LANG_Dec
DEC LANG : IF LANG<1 THEN LANG=10
LANG_Change
END SUB

SUB LANG_Inc
INC LANG : IF LANG>10 THEN LANG=1
LANG_Change
END SUB

SUB Canvas5Redraw (Sender AS QCANVAS)
Sender.Rectangle (3, 3, 778, 362, &H000000)
Sender.FillRect (5, 5, 776, 360, &HB09070)
Sender.Line (4, 4, 776, 4, &HD0B090)
Sender.Line (776, 5, 776, 360, &HD0B090)
Sender.Line (4, 4, 4, 360, &H907050)
Sender.Line (5, 360, 776, 360, &H907050)
YY=20 : FOR Z=0 TO 6
Sender.FillRect (161, YY, 207, YY+25, &H504030)
Sender.Line (160, YY-1, 207, YY-1, &HA08060)
Sender.Line (207, YY, 207, YY+25, &HA08060)
Sender.Line (160, YY-2, 208, YY-2, &HA08060)
Sender.Line (208, YY-1, 208, YY+26, &HA08060)
Sender.Line (160, YY-1, 160, YY+25, &HE0C0A0)
Sender.Line (161, YY+25, 206, YY+25, &HE0C0A0)
Sender.Line (159, YY-2, 159, YY+26, &HE0C0A0)
Sender.Line (160, YY+26, 207, YY+26, &HE0C0A0)
INC (YY,50) : NEXT
YY=18 : FOR Z=0 TO 4
Sender.Rectangle (241, YY, 404, YY+30, &H000000)
Sender.FillRect (243, YY+2, 402, YY+28, &HE0C0A0)
Sender.Line (242, YY+1, 402, YY+1, &HFFE0C0)
Sender.Line (402, YY+2, 402, YY+28, &HFFE0C0)
Sender.Line (242, YY+1, 242, YY+28, &HC0A080)
Sender.Line (243, YY+28, 402, YY+28, &HC0A080)
Sender.FillRect (421, YY+1, 474, YY+29, &HE0C0A0)
Sender.Line (420, YY, 474, YY, &HFFE0C0)
Sender.Line (474, YY+1, 474, YY+29, &HFFE0C0)
Sender.Line (420, YY, 420, YY+29, &HC0A080)
Sender.Line (421, YY+29, 474, YY+29, &HC0A080)

Sender.Rectangle (511, YY, 674, YY+30, &H000000)
Sender.FillRect (513, YY+2, 672, YY+28, &HE0C0A0)
Sender.Line (512, YY+1, 672, YY+1, &HFFE0C0)
Sender.Line (672, YY+2, 672, YY+28, &HFFE0C0)
Sender.Line (512, YY+1, 512, YY+28, &HC0A080)
Sender.Line (513, YY+28, 672, YY+28, &HC0A080)
Sender.FillRect (691, YY+1, 754, YY+29, &HE0C0A0)
Sender.Line (690, YY, 754, YY, &HFFE0C0)
Sender.Line (754, YY+1, 754, YY+29, &HFFE0C0)
Sender.Line (690, YY, 690, YY+29, &HC0A080)
Sender.Line (691, YY+29, 754, YY+29, &HC0A080)
INC (YY,50) : NEXT
Sender.Rectangle (241, YY, 404, YY+30, &H000000)
Sender.FillRect (243, YY+2, 402, YY+28, &HE0C0A0)
Sender.Line (242, YY+1, 402, YY+1, &HFFE0C0)
Sender.Line (402, YY+2, 402, YY+28, &HFFE0C0)
Sender.Line (242, YY+1, 242, YY+28, &HC0A080)
Sender.Line (243, YY+28, 402, YY+28, &HC0A080)
Sender.FillRect (421, YY+2, 594, YY+28, &HE0C0A0)
Sender.Line (420, YY+1, 594, YY+1, &HFFE0C0)
Sender.Line (594, YY+2, 594, YY+28, &HFFE0C0)
Sender.Line (420, YY+1, 420, YY+28, &HC0A080)
Sender.Line (421, YY+28, 594, YY+28, &HC0A080)
Sender.Rectangle (241, 322, 450, 352, &H000000)
Sender.FillRect (243, 324, 448, 350, &HD0B090)
Sender.Line (242, 323, 448, 323, &HF0D0B0)
Sender.Line (448, 324, 448, 350, &HF0D0B0)
Sender.Line (242, 323, 242, 350, &HB09070)
Sender.Line (243, 350, 448, 350, &HB09070)
Sender.FillRect (463, 323, 687, 351, &HE0C0A0)
Sender.Line (462, 322, 687, 322, &HFFE0C0)
Sender.Line (687, 323, 687, 351, &HFFE0C0)
Sender.Line (462, 322, 462, 351, &HC0A080)
Sender.Line (463, 351, 687, 351, &HC0A080)
Sender.Rectangle (701, 322, 768, 352, &H000000)
Sender.FillRect (703, 324, 766, 350, &HD0B090)
Sender.Line (702, 323, 766, 323, &HF0D0B0)
Sender.Line (766, 324, 766, 350, &HF0D0B0)
Sender.Line (702, 323, 702, 350, &HB09070)
Sender.Line (703, 350, 766, 350, &HB09070)
Sender.TextOut (247, 18, "WORD SPLIT", &HB09070, -1)
Sender.TextOut (270, 18, "O", &HFFFFFF, -1)
Sender.TextOut (531, 18, "Root Drive", &HB09070, -1)
Sender.TextOut (592, 18, "D", &HFFFFFF, -1)
Sender.TextOut (265, 68, "SPELLING", &HB09070, -1)
Sender.TextOut (346, 68, "N", &HFFFFFF, -1)
Sender.TextOut (527, 68, "DEF. WAVs", &HB09070, -1)
Sender.TextOut (589, 68, "W", &HFFFFFF, -1)
Sender.TextOut (276, 118, "SPEECH", &HB09070, -1)
Sender.TextOut (292, 118, "P", &HFFFFFF, -1)
Sender.TextOut (527, 118, "FOR. WAVs", &HB09070, -1)
Sender.TextOut (629, 118, "V", &HFFFFFF, -1)
Sender.TextOut (287, 168, "ANDOM", &HB09070, -1)
Sender.TextOut (269, 168, "R", &HFFFFFF, -1)
Sender.TextOut (527, 168, "DEF. SFILE", &HB09070, -1)
Sender.TextOut (605, 168, "F", &HFFFFFF, -1)
Sender.TextOut (262, 218, "MISC. ALL", &HB09070, -1)
Sender.TextOut (281, 218, "I", &HFFFFFF, -1)
Sender.TextOut (527, 218, "FOR. SFILE", &HB09070, -1)
Sender.TextOut (629, 218, "L", &HFFFFFF, -1)
Sender.TextOut (257, 268, "LANGUAGE", &HB09070, -1)
Sender.TextOut (354, 268, "G", &HFFFFFF, -1)
Sender.TextOut (249, 322, "SAVE SETTINGS", &HA08060, -1)
Sender.TextOut (249, 322, "S", &HFFFFFF, -1)
Sender.TextOut (706, 322, "EXIT", &HA08060, -1)
Sender.TextOut (706, 322, "E", &HFFFFFF, -1)
SPLIT_Change
SPELL_Change
SPEECH_Change
SEQRND_Change
MISC_Change
LANG_Change
DRIVE_Change
DWAV_Change
FWAV_Change
DSFILE_Change
FSFILE_Change
END SUB

SUB MouseDown (Button AS BYTE, X AS WORD, Y AS WORD, Shift AS INTEGER)
IF MN=0 THEN
IF Button=0 AND Shift=0 THEN
IF (Y>456 AND Y<487) THEN
IF (X>105 AND X<209) THEN
IF LRN=0 THEN
Reveal_Words
ELSE
Reveal_Sentences
END IF
ELSEIF (X>222 AND X<297) THEN
IF LRN=0 THEN
Next_Words
ELSE
Next_Sentences
END IF
ELSEIF (X>310 AND X<400) THEN
SO_Check : Speak_ToMe : SO_Check
ELSEIF (X>413 AND X<524) THEN
MN=1 : MN_Change
ELSEIF (X>537 AND X<657) THEN
Window3.ShowModal
ELSEIF (X>670 AND X<697) THEN
Up_SW
ELSEIF (X>710 AND X<737) THEN
Down_SW
ELSEIF (X>750 AND X<774) THEN
Window2.ShowModal
ELSEIF (X>779 AND X<790) THEN
CleanUp
Window1.Close
END IF
ELSE

END IF
IF (X>15 AND X<43) THEN
IF (Y>37 AND Y<58) THEN
DS_Check
ELSEIF (Y>114 AND Y<135) THEN
FS_Check
ELSEIF (Y>172 AND Y<193) THEN
DP_Check
ELSEIF (Y>219 AND Y<240) THEN
FP_Check
ELSEIF (Y>268 AND Y<289) THEN
DJ_Check
ELSEIF (Y>315 AND Y<336) THEN
FJ_Check
ELSEIF (Y>365 AND Y<386) THEN
DV_Check
ELSEIF (Y>412 AND Y<433) THEN
FV_Check
ELSE

END IF
ELSE

END IF
ELSE

END IF
ELSE
IF PST=0 THEN
IF (Y>456 AND Y<487) THEN
IF (X>2 AND X<92) THEN
PO_Check
ELSEIF (X>413 AND X<524) THEN
MN=0 : MN_Change
END IF
END IF
ELSE
IF (Y>456 AND Y<487) THEN
IF (X>2 AND X<92) THEN
AMT=0 : PST=0 : PO=0 : PO_Change
END IF
END IF
END IF
END IF
END SUB

SUB KeyDown(Key AS WORD, Shift AS INTEGER)
IF MN=0 THEN
IF Shift=0 THEN
IF Key=82 THEN
IF LRN=0 THEN
Reveal_Words
ELSE
Reveal_Sentences
END IF
ELSEIF Key=78 THEN
IF LRN=0 THEN
Next_Words
ELSE
Next_Sentences
END IF
ELSEIF Key=83 THEN
SO_Check : Speak_ToMe : SO_Check
ELSEIF Key=79 THEN
Window3.ShowModal
ELSEIF Key=38 THEN
Up_SW
ELSEIF Key=40 THEN
Down_SW
ELSEIF Key=65 THEN
MN=1 : MN_Change
END IF
ELSEIF Shift=256 THEN
IF Key=191 THEN
Window2.ShowModal
ELSEIF Key=81 THEN
CleanUp
Window1.Close
END IF
END IF
ELSE
IF PST=0 THEN
IF Key=80 THEN
PO_Check
ELSEIF Key=77 THEN
MN=0 : MN_Change
END IF
ELSE
IF Key=80 THEN
AMT=0 : PST=0 : PO=0 : PO_Change
END IF
END IF
END IF
END SUB

SUB Key3Down(Key AS WORD, Shift AS INTEGER)
IF Shift=0 THEN
IF (Key>48 AND Key<58) THEN
CPVAL=(Key-49) : CP_Check
ELSEIF Key=48 THEN
CPVAL=9 : CP_Check
ELSEIF Key=189 THEN
CPVAL=10 : CP_Check
ELSEIF Key=38 THEN
DEC CPVAL
IF CPVAL=65535 THEN CPVAL=21
CP_Check
ELSEIF Key=40 THEN
INC CPVAL
IF CPVAL>21 THEN CPVAL=0
CP_Check
ELSEIF Key=83 THEN
SRCHSTS=0 : Window4.ShowModal
ELSEIF Key=78 THEN
Window5.ShowModal
ELSEIF Key=87 THEN
CURDT=0 : LRN=0 : OLDPAA=10 : CURPAA=1 : DT_Check
ELSEIF Key=84 THEN
CURDT=1 : LRN=1 : OLDPAA=10 : CURPAA=0 : DT_Check
ELSEIF Key=69 THEN
Window3.Close
END IF
ELSEIF Shift=256 THEN
IF (Key>48 AND Key<58) THEN
CPVAL=(Key-38) : CP_Check
ELSEIF Key=48 THEN
CPVAL=20 : CP_Check
ELSEIF Key=189 THEN
CPVAL=21 : CP_Check
ELSEIF Key=87 THEN
CURDT=2 : LRN=0 : OLDPAA=10 : CURPAA=1 : DT_Check
ELSEIF Key=84 THEN
CURDT=3 : LRN=0 : OLDPAA=10 : CURPAA=1 : DT_Check
END IF
END IF
END SUB

SUB Mouse3Down (Button AS BYTE, X AS WORD, Y AS WORD, Shift AS INTEGER)
DIM CHK AS BYTE
CHK=0
IF Button=0 AND Shift=0 THEN
IF (Y>456 AND Y<487) THEN
IF (X>2 AND X<109) THEN
SRCHSTS=0 : Window4.ShowModal
ELSEIF (X>122 AND X<254) THEN
Window5.ShowModal
ELSEIF (X>267 AND X<371) THEN
CURDT=0 : LRN=0 : OLDPAA=10 : CURPAA=1 : DT_Check
ELSEIF (X>384 AND X<538) THEN
CURDT=1 : LRN=1 : OLDPAA=10 : CURPAA=0 : DT_Check
ELSEIF (X>550 AND X<709) THEN

ELSEIF (X>722 AND X<790) THEN
Window3.Close
END IF
ELSEIF ((X>350 AND X<380) OR (X>747 AND X<777)) THEN
CHK=1
IF (Y>13 AND Y<41) THEN
CPVAL=0 : CHK=2
ELSEIF (Y>53 AND Y<81) THEN
CPVAL=1 : CHK=2
ELSEIF (Y>93 AND Y<121) THEN
CPVAL=2 : CHK=2
ELSEIF (Y>133 AND Y<161) THEN
CPVAL=3 : CHK=2
ELSEIF (Y>173 AND Y<201) THEN
CPVAL=4 : CHK=2
ELSEIF (Y>213 AND Y<241) THEN
CPVAL=5 : CHK=2
ELSEIF (Y>253 AND Y<281) THEN
CPVAL=6 : CHK=2
ELSEIF (Y>293 AND Y<321) THEN
CPVAL=7 : CHK=2
ELSEIF (Y>333 AND Y<361) THEN
CPVAL=8 : CHK=2
ELSEIF (Y>373 AND Y<401) THEN
CPVAL=9 : CHK=2
ELSEIF (Y>413 AND Y<441) THEN
CPVAL=10 : CHK=2
END IF
IF CHK=2 THEN
IF (X>727 AND X<777) THEN INC (CPVAL,11)
CP_Check
END IF
END IF
ELSEIF Button=1 AND Shift=0 THEN
IF (Y>456 AND Y<487) THEN
IF (X>267 AND X<371) THEN
CURDT=2 : LRN=0 : OLDPAA=10 : CURPAA=1 : DT_Check
ELSEIF (X>384 AND X<538) THEN
CURDT=3 : LRN=1 : OLDPAA=10 : CURPAA=0 : DT_Check
END IF
END IF
END IF
END SUB

SUB Key4Down(Key AS WORD, Shift AS INTEGER)
IF Shift=16 THEN
IF Key=69 THEN
Window4.Close
ELSEIF Key=68 THEN
CURDF=0 : DF_Check
ELSEIF Key=70 THEN
CURDF=1 : DF_Check
ELSEIF Key=78 THEN
IF LRN=1 THEN
CURPAA=0 : PAA_Check
END IF
ELSEIF Key=85 THEN
IF LRN=0 THEN
CURPAA=1 : PAA_Check
END IF
ELSEIF Key=74 THEN
IF LRN=0 THEN
CURPAA=2 : PAA_Check
END IF
ELSEIF Key=82 THEN
IF LRN=0 THEN
CURPAA=3 : PAA_Check
END IF
ELSEIF Key=67 THEN
Continue_WS
END IF
ELSE
IF Key=13 THEN
Search_WS
END IF
END IF
END SUB

SUB Mouse4Down (Button AS BYTE, X AS WORD, Y AS WORD, Shift AS INTEGER)
IF (Button=0 AND Shift=0) THEN
IF (X>18 AND X<171) THEN
IF (Y>18 AND Y<47) THEN
CURDF=0 : DF_Check
ELSEIF (Y>62 AND Y<91) THEN
CURDF=1 : DF_Check
ELSEIF (Y>124 AND Y<153) THEN
IF LRN=1 THEN
CURPAA=0 : PAA_Check
END IF
ELSEIF (Y>168 AND Y<197) THEN
IF LRN=0 THEN
CURPAA=1 : PAA_Check
END IF
ELSEIF (Y>212 AND Y<241) THEN
IF LRN=0 THEN
CURPAA=2 : PAA_Check
END IF
ELSEIF (Y>256 AND Y<285) THEN
IF LRN=0 THEN
CURPAA=3 : PAA_Check
END IF
END IF
ELSEIF (X>328 AND X<464) THEN
IF (Y>121 AND Y<152) THEN
Continue_WS
END IF
ELSEIF (X>695 AND X<763) THEN
IF (Y>121 AND Y<152) THEN
Window4.Close
END IF
END IF
END IF
END SUB

SUB Settings_Error(err AS BYTE)
ShowMessage("Settings File - Invalid Value"+" "+str$(err))
Application.Terminate
END SUB

SUB Load_Settings
IF DirExists ("C:\\LanguageGUI\\") <> 0 THEN
IF FileExists ("C:\\LanguageGUI\\LGUI.Settings") <> 0 THEN
IF File.Open ("C:\\LanguageGUI\\LGUI.Settings", fmOpenRead) <> 0 THEN
FLen=File.Size
IF FLen=67 THEN
LANG=File.ReadNum(1) : IF (LANG<1 OR LANG>10) THEN Settings_Error(0)
Root_Dir$=File.ReadLine()
DName$(0)=Root_Dir$
DName$(1)=Root_Dir$+"LGUI_English"
DName$(2)=Root_Dir$+"LGUI_French"
DName$(3)=Root_Dir$+"LGUI_German"
DName$(4)=Root_Dir$+"LGUI_Indonesian"
DName$(5)=Root_Dir$+"LGUI_Italian"
DName$(6)=Root_Dir$+"LGUI_Korean"
DName$(7)=Root_Dir$+"LGUI_Norwegian"
DName$(8)=Root_Dir$+"LGUI_Spanish"
DName$(9)=Root_Dir$+"LGUI_Swedish"
DName$(10)=Root_Dir$+"LGUI_Tagalog"
FName$(0)=DName$(LANG)+"\\DASCII_Files\\DTitles.txt"
FName$(1)=DName$(LANG)+"\\FASCII_Files\\FTitles.txt"
FName$(2)=DName$(LANG)+"\\DASCII_Files\\DSentences.txt"
FName$(3)=DName$(LANG)+"\\FASCII_Files\\FSentences.txt"
FName$(4)=DName$(LANG)+"\\DASCII_Files\\DNouns.txt"
FName$(5)=DName$(LANG)+"\\FASCII_Files\\FNouns.txt"
FName$(6)=DName$(LANG)+"\\DASCII_Files\\DAdjectives.txt"
FName$(7)=DName$(LANG)+"\\FASCII_Files\\FAdjectives.txt"
FName$(8)=DName$(LANG)+"\\DASCII_Files\\DVerbs.txt"
FName$(9)=DName$(LANG)+"\\FASCII_Files\\FVerbs.txt"
DS=File.ReadNum(1) : IF (DS<0 OR DS>1) THEN Settings_Error(1)
FS=File.ReadNum(1) : IF (FS<0 OR FS>1) THEN Settings_Error(2)
DP=File.ReadNum(1) : IF (DP<0 OR DP>1) THEN Settings_Error(3)
FP=File.ReadNum(1) : IF (FP<0 OR FP>1) THEN Settings_Error(4)
DJ=File.ReadNum(1) : IF (DJ<0 OR DJ>1) THEN Settings_Error(5)
FJ=File.ReadNum(1) : IF (FJ<0 OR FJ>1) THEN Settings_Error(6)
DV=File.ReadNum(1) : IF (DV<0 OR DV>1) THEN Settings_Error(7)
FV=File.ReadNum(1) : IF (FV<0 OR FV>1) THEN Settings_Error(8)
MN=File.ReadNum(1) : IF (MN<0 OR MN>1) THEN Settings_Error(9)
LRN=File.ReadNum(1) : IF (LRN<0 OR LRN>1) THEN Settings_Error(10)
NX=File.ReadNum(1) : IF (NX<0 OR NX>1) THEN Settings_Error(11)
FWD=File.ReadNum(1) : IF (FWD<0 OR FWD>1) THEN Settings_Error(12)
SPLIT=File.ReadNum(1) : IF (SPLIT<0 OR SPLIT>1) THEN Settings_Error(13)
SPELL=File.ReadNum(1) : IF (SPELL<0 OR SPELL>1) THEN Settings_Error(14)
SPEECH=File.ReadNum(1) : IF (SPEECH<0 OR SPEECH>1) THEN Settings_Error(15)
MISC=File.ReadNum(1) : IF (MISC<0 OR MISC>1) THEN Settings_Error(16)
SEQRND=File.ReadNum(1) : IF (SEQRND<0 OR SEQRND>1) THEN Settings_Error(17)
DFDELAY=File.ReadNum(1)
IF (DFDELAY<0 OR DFDELAY>9) THEN
Settings_Error(18)
ELSE
Edit1.Text=STR$(DFDELAY)
END IF
AMDELAY=File.ReadNum(1)
IF (AMDELAY<0 OR AMDELAY>9) THEN
Settings_Error(19)
ELSE
Edit2.Text=STR$(AMDELAY)
END IF
SPDELAY=File.ReadNum(1)
IF (SPDELAY<0 OR SPDELAY>9) THEN
Settings_Error(20)
ELSE
Edit3.Text=STR$(SPDELAY)
END IF
WSDELAY=File.ReadNum(1)
IF (WSDELAY<0 OR WSDELAY>9) THEN
Settings_Error(21)
ELSE
Edit4.Text=STR$(WSDELAY)
END IF
RVDELAY=File.ReadNum(1)
IF (RVDELAY<0 OR RVDELAY>9) THEN
Settings_Error(22)
ELSE
Edit5.Text=STR$(RVDELAY)
END IF
STOPDELAY=File.ReadNum(1)
IF (STOPDELAY<0 OR STOPDELAY>9) THEN
Settings_Error(23)
ELSE
Edit6.Text=STR$(STOPDELAY)
END IF
NAVDELAY=File.ReadNum(1)
IF (NAVDELAY<0 OR NAVDELAY>9) THEN
Settings_Error(24)
ELSE
Edit7.Text=STR$(NAVDELAY)
END IF
OLDCP=File.ReadNum(1)
CURCP=File.ReadNum(1)
CPVAL=File.ReadNum(1)
OLDDF=File.ReadNum(1)
CURDF=File.ReadNum(1)
OLDPAA=File.ReadNum(1)
CURPAA=File.ReadNum(1)
OLDDT=File.ReadNum(1)
CURDT=File.ReadNum(1)
OLDSEQ=File.ReadNum(4)
CURSEQ=File.ReadNum(4)
NEXTSEQ=File.ReadNum(4)
DWAV=File.ReadNum(1)
FWAV=File.ReadNum(1)
DSFILE=File.ReadNum(1)
FSFILE=File.ReadNum(1)
IF DWAV=1 THEN
DSpeech_Dir$="English_WAVs\\"
ELSEIF DWAV=2 THEN
DSpeech_Dir$="French_WAVs\\"
ELSEIF DWAV=3 THEN
DSpeech_Dir$="German_WAVs\\"
ELSEIF DWAV=4 THEN
DSpeech_Dir$="Indonesian_WAVs\\"
ELSEIF DWAV=5 THEN
DSpeech_Dir$="Italian_WAVs\\"
ELSEIF DWAV=6 THEN
DSpeech_Dir$="Korean_WAVs\\"
ELSEIF DWAV=7 THEN
DSpeech_Dir$="Norwegian_WAVs\\"
ELSEIF DWAV=8 THEN
DSpeech_Dir$="Spanish_WAVs\\"
ELSEIF DWAV=9 THEN
DSpeech_Dir$="Swedish_WAVs\\"
ELSEIF DWAV=10 THEN
DSpeech_Dir$="Tagalog_WAVs\\"
END IF
IF FWAV=1 THEN
FSpeech_Dir$="English_WAVs\\"
ELSEIF FWAV=2 THEN
FSpeech_Dir$="French_WAVs\\"
ELSEIF FWAV=3 THEN
FSpeech_Dir$="German_WAVs\\"
ELSEIF FWAV=4 THEN
FSpeech_Dir$="Indonesian_WAVs\\"
ELSEIF FWAV=5 THEN
FSpeech_Dir$="Italian_WAVs\\"
ELSEIF FWAV=6 THEN
FSpeech_Dir$="Korean_WAVs\\"
ELSEIF FWAV=7 THEN
FSpeech_Dir$="Norwegian_WAVs\\"
ELSEIF FWAV=8 THEN
FSpeech_Dir$="Spanish_WAVs\\"
ELSEIF FWAV=9 THEN
FSpeech_Dir$="Swedish_WAVs\\"
ELSEIF FWAV=10 THEN
FSpeech_Dir$="Tagalog_WAVs\\"
END IF
FName$(10)=DName$(DSFILE)+"\\DASCII_Files\\DSSpeech.txt"
FName$(11)=DName$(FSFILE)+"\\FASCII_Files\\FSSpeech.txt"
FName$(12)=DName$(DSFILE)+"\\DASCII_Files\\DPSpeech.txt"
FName$(13)=DName$(FSFILE)+"\\FASCII_Files\\FPSpeech.txt"
FName$(14)=DName$(DSFILE)+"\\DASCII_Files\\DJSpeech.txt"
FName$(15)=DName$(FSFILE)+"\\FASCII_Files\\FJSpeech.txt"
FName$(16)=DName$(DSFILE)+"\\DASCII_Files\\DVSpeech.txt"
FName$(17)=DName$(FSFILE)+"\\FASCII_Files\\FVSpeech.txt"
File.Close
ELSE
File.Close
ShowMessage("C:\\LanguageGUI\\LGUI.Settings\n\n     File Has An Incorrect Size")
Application.Terminate
END IF
ELSE
ShowMessage("C:\\LanguageGUI\\LGUI.Settings\n\n         File Was NOT Loaded")
Application.Terminate
END IF
ELSE
ShowMessage("C:\\LanguageGUI\\LGUI.Settings\n\n         File Was NOT Found")
Application.Terminate
END IF
ELSE
ShowMessage("             C:\\LanguageGUI\n\nDirectory/Folder Was NOT Found")
Application.Terminate
END IF
END SUB

SUB Save_Settings
Canvas5.FillRect (463, 323, 687, 351, &HE0C0A0)
IF DirExists ("C:\\LanguageGUI\\") <> 0 THEN
IF File.Open ("C:\\LanguageGUI\\LGUI.Settings", fmCreate) <> 0 THEN
File.WriteNum(LANG, 1)
FStg$=REPLACE$(Root_Dir$, Left$(drive$(Drv_Cnt), 1), 1)
File.WriteLine(FStg$)
File.WriteNum(DS, 1)
File.WriteNum(FS, 1)
File.WriteNum(DP, 1)
File.WriteNum(FP, 1)
File.WriteNum(DJ, 1)
File.WriteNum(FJ, 1)
File.WriteNum(DV, 1)
File.WriteNum(FV, 1)
File.WriteNum(MN, 1)
File.WriteNum(LRN, 1)
File.WriteNum(NX, 1)
File.WriteNum(FWD, 1)
File.WriteNum(SPLIT, 1)
File.WriteNum(SPELL, 1)
File.WriteNum(SPEECH, 1)
File.WriteNum(MISC, 1)
File.WriteNum(SEQRND, 1)
File.WriteNum(DFDELAY, 1)
File.WriteNum(AMDELAY, 1)
File.WriteNum(SPDELAY, 1)
File.WriteNum(WSDELAY, 1)
File.WriteNum(RVDELAY, 1)
File.WriteNum(STOPDELAY, 1)
File.WriteNum(NAVDELAY, 1)
File.WriteNum(OLDCP, 1)
File.WriteNum(CURCP, 1)
File.WriteNum(CPVAL, 1)
File.WriteNum(OLDDF, 1)
File.WriteNum(CURDF, 1)
OLDPAA=10
File.WriteNum(OLDPAA, 1)
File.WriteNum(CURPAA, 1)
OLDDT=10
File.WriteNum(OLDDT, 1)
File.WriteNum(CURDT, 1)
File.WriteNum(OLDSEQ, 4)
File.WriteNum(CURSEQ, 4)
File.WriteNum(NEXTSEQ, 4)
File.WriteNum(DWAV, 1)
File.WriteNum(FWAV, 1)
File.WriteNum(DSFILE, 1)
File.WriteNum(FSFILE, 1)
File.Close
Canvas5.TextOut(470, 322, "Settings Saved", &HB09070, -1)
ELSE
Canvas5.TextOut (470, 322, "File Not Opened", &HB09070, -1)
END IF
ELSE
Canvas5.TextOut (470, 322, "Dir. Not Found", &HB09070, -1)
END IF
END SUB

SUB Update_Delays
FStg$=LEFT$(Edit1.Text, 1)
IF (FStg$<"0" OR FStg$>"9") THEN
Edit1.Text="0" : DFDELAY=0
ELSE
DFDELAY=VAL(FStg$)
END IF
FStg$=LEFT$(Edit2.Text, 1)
IF (FStg$<"0" OR FStg$>"9") THEN
Edit2.Text="0" : AMDELAY=0
ELSE
AMDELAY=VAL(FStg$)
END IF
FStg$=LEFT$(Edit3.Text, 1)
IF (FStg$<"0" OR FStg$>"9") THEN
Edit3.Text="0" : SPDELAY=0
ELSE
SPDELAY=VAL(FStg$)
END IF
FStg$=LEFT$(Edit4.Text, 1)
IF (FStg$<"0" OR FStg$>"9") THEN
Edit4.Text="0" : WSDELAY=0
ELSE
WSDELAY=VAL(FStg$)
END IF
FStg$=LEFT$(Edit5.Text, 1)
IF (FStg$<"0" OR FStg$>"9") THEN
Edit5.Text="0" : RVDELAY=0
ELSE
RVDELAY=VAL(FStg$)
END IF
FStg$=LEFT$(Edit6.Text, 1)
IF (FStg$<"0" OR FStg$>"9") THEN
Edit6.Text="0" : STOPDELAY=0
ELSE
STOPDELAY=VAL(FStg$)
END IF
FStg$=LEFT$(Edit7.Text, 1)
IF (FStg$<"0" OR FStg$>"9") THEN
Edit7.Text="0" : NAVDELAY=0
ELSE
NAVDELAY=VAL(FStg$)
END IF
END SUB

SUB Key5Down(Key AS WORD, Shift AS INTEGER)
IF Shift=0 THEN
IF Key=69 THEN
Window5.Close
ELSEIF Key=68 THEN
INC Drv_Cnt
IF Drv_Cnt=>NumDrives THEN
Drv_Cnt=0
END IF
DRIVE_Change
ELSEIF Key=70 THEN
DSFILE_Inc
ELSEIF Key=71 THEN
LANG_Inc
ELSEIF Key=76 THEN
FSFILE_Inc
ELSEIF Key=79 THEN
SPLIT_Check
ELSEIF Key=78 THEN
SPELL_Check
ELSEIF Key=80 THEN
SPEECH_Check
ELSEIF Key=82 THEN
SEQRND_Check
ELSEIF Key=73 THEN
MISC_Check
ELSEIF Key=87 THEN
DWAV_Inc
ELSEIF Key=86 THEN
FWAV_Inc
ELSEIF Key=83 THEN
SAVE_Settings
ELSEIF Key=13 THEN
Update_Delays
Window5.Repaint
END IF
ELSEIF Shift=256 THEN
IF Key=71 THEN
LANG_Dec
END IF
END IF
Update_Delays
END SUB

SUB Mouse5Down (Button AS BYTE, X AS WORD, Y AS WORD, Shift AS INTEGER)
IF (Button=0 AND Shift=0) THEN
IF (X>240 AND X<404) THEN
IF (Y>17 AND Y<48) THEN
SPLIT_Check
ELSEIF (Y>67 AND Y<98) THEN
SPELL_Check
ELSEIF (Y>117 AND Y<148) THEN
SPEECH_Check
ELSEIF (Y>167 AND Y<198) THEN
SEQRND_Check
ELSEIF (Y>217 AND Y<248) THEN
MISC_Check
ELSEIF (Y>267 AND Y<298) THEN
LANG_Inc
END IF
END IF
IF (X>510 AND X<674) THEN
IF (Y>17 AND Y<48) THEN
INC Drv_Cnt
IF Drv_Cnt=>NumDrives THEN
Drv_Cnt=0
END IF
DRIVE_Change
ELSEIF (Y>67 AND Y<98) THEN
DWAV_Inc
ELSEIF (Y>117 AND Y<148) THEN
FWAV_Inc
ELSEIF (Y>167 AND Y<198) THEN
DSFILE_Inc
ELSEIF (Y>217 AND Y<248) THEN
FSFILE_Inc
ELSEIF (Y>267 AND Y<298) THEN

END IF
END IF
IF (Y>321 AND Y<352) THEN
IF (X>240 AND X<450) THEN
SAVE_Settings
ELSEIF (X>700 AND X<768) THEN
Window5.Close
END IF
END IF
ELSEIF (Button=1 AND Shift=0) THEN
IF (Y>317 AND Y<348) THEN
LANG_Dec
END IF
END IF
Update_Delays
END SUB

Window1.Left=0 : Window1.Top=0 : Window1.Width=800 : Window1.Height=600
Window1.BorderStyle=bsNone : Window1.WindowState=wsNormal : Window1.Color=&HB8CCD8
Window1.FormStyle=fsStayOnTop : Window1.Caption=myFormName : Window1.OnKeyDown=KeyDown
Window1.OnShow=Blank_Window

Font1.Name="Tahoma Bold" : Font1.Size=18 : Font1.Color=&H000000
Font2.Name="Verdana" : Font2.Size=17 : Font2.Color=&H000000
Font3.Name="Verdana" : Font3.Size=14 : Font3.Color=&H000000
Font4.Name="Tahoma" : Font4.Size=16 : Font4.Color=&H000000
Font5.Name="Verdana" : Font5.Size=13 : Font5.Color=&H587C90
Font6.Name="Tahoma Bold" : Font6.Size=18 : Font6.Color=&H907050
Font7.Name="Tahoma Bold" : Font7.Size=12 : Font7.Color=&HFFFFFF
Font8.Name="Tahoma Bold" : Font8.Size=18 : Font8.Color=&H005090
Font9.Name="Tahoma Bold" : Font9.Size=10 : Font9.Color=&H00FFFF
Font10.Name="Tahoma Bold" : Font10.Size=10 : Font10.Color=&HFFFFFF
Font11.Name="Tahoma Bold" : Font11.Size=10 : Font11.Color=&H0000FF
Font12.Name="Tahoma Bold" : Font12.Size=13 : Font12.Color=&H000000

Canvas1.Parent=Window1 :  Canvas1.Font=Font2 : Canvas1.Left=0
Canvas1.Top=0 : Canvas1.Width=800 : Canvas1.Height=600
Canvas1.OnMouseDown=MouseDown : Canvas1.OnPaint=Canvas1Redraw

Label1.Parent=Window1 : Label1.Font=Font1 :  Label1.Angle=0
Label1.Left=57 : Label1.Top=33 : Label1.Caption="Sentences"
Label1.Color=&H98BCD0 :  Label1.Cursor=crDefault

Label24.Parent=Window1 : Label24.Font=Font12 :  Label24.Angle=0
Label24.Left=47 : Label24.Top=114 : Label24.Caption="Mga Pangungusap"
Label24.Color=&H98BCD0 :  Label24.Cursor=crDefault

Label2.Parent=Window1 : Label2.Font=Font1 :  Label2.Angle=0
Label2.Left=59 : Label2.Top=168 : Label2.Caption="Pro/Nouns"
Label2.Color=&H98BCD0 :  Label2.Cursor=crDefault

Label21.Parent=Window1 : Label21.Font=Font12 :  Label21.Angle=0
Label21.Left=55 : Label21.Top=219 : Label21.Caption="Mga Pangngalan"
Label21.Color=&H98BCD0 :  Label21.Cursor=crDefault

Label3.Parent=Window1 : Label3.Font=Font1 :  Label3.Angle=0
Label3.Left=64 : Label3.Top=264 : Label3.Caption="Adjectives"
Label3.Color=&H98BCD0 :  Label3.Cursor=crDefault

Label22.Parent=Window1 : Label22.Font=Font12 :  Label22.Angle=0
Label22.Left=68 : Label22.Top=315 : Label22.Caption="Mga Pang-Uri"
Label22.Color=&H98BCD0 :  Label22.Cursor=crDefault

Label4.Parent=Window1 : Label4.Font=Font1 :  Label4.Angle=0
Label4.Left=70 : Label4.Top=361 : Label4.Caption="Ad/Verbs"
Label4.Color=&H98BCD0 :  Label4.Cursor=crDefault

Label23.Parent=Window1 : Label23.Font=Font12 :  Label23.Angle=0
Label23.Left=69 : Label23.Top=412 : Label23.Caption="Mga Pandiwa"
Label23.Color=&H98BCD0 :  Label23.Cursor=crDefault

Label19.Parent=Window1 : Label19.Font=Font11 :  Label19.Angle=0
Label19.Left=90 : Label19.Top=552 : Label19.Caption="Please feel free to contact me if you need any help with LanguageGUI and/or Tagalog or English."
Label19.Color=&H000000 :  Label19.Cursor=crDefault

Label7.Parent=Window1 : Label7.Font=Font9 :  Label7.Angle=0
Label7.Left=3 : Label7.Top=574 : Label7.Caption="LanguageGUI Hompage"
Label7.Color=&H000000 :  Label7.Cursor=crDefault

Label20.Parent=Window1 : Label20.Font=Font7 :  Label20.Angle=0
Label20.Left=164 : Label20.Top=572 : Label20.Caption="http://web.onetel.net.uk/~yoingco/yoingco/"
Label20.Color=&H000000 :  Label20.Cursor=crDefault

Label18.Parent=Window1 : Label18.Font=Font9 :  Label18.Angle=0
Label18.Left=545 : Label18.Top=574 : Label18.Caption="Helping Language Learners Worldwide."
Label18.Color=&H000000 :  Label18.Cursor=crDefault

'Label8.Parent=Window1 : Label8.Font=Font9 :  Label8.Angle=0
'Label8.Left=600 : Label8.Top=554 : Label8.Caption=""
'Label8.Color=&H000000 :  Label8.Cursor=crDefault

Window2.Left=350 : Window2.Top=100 : Window2.Width=299 : Window2.Height=273
Window2.BorderStyle=bsNone : Window2.WindowState=wsNormal : Window2.FormStyle=fsStayOnTop
Window2.Color=&H000000 : Window2.OnKeyDown=KeyClose2

Canvas2.Parent=Window2 :  Canvas2.Font=Font3 : Canvas2.Left=0
Canvas2.Top=0 : Canvas2.Width=299 : Canvas2.Height=273
Canvas2.Color=&HB8CCD8 : Canvas2.OnPaint=Canvas2Redraw
Canvas2.OnMouseDown=MouseClose2

Label5.Parent=Window2 : Label5.Font=Font4 :  Label5.Angle=0
Label5.Left=52 : Label5.Top=6 : Label5.Caption=Application.Title
Label5.Color=&HB8CCD8 :  Label5.Cursor=crDefault

Label6.Parent=Window2 : Label6.Font=Font4 :  Label6.Angle=0
Label6.Left=44 : Label6.Top=193 : Label6.Caption="yoingco@onetel.net.uk"
Label6.Color=&HB8CCD8 :  Label6.Cursor=crDefault

Window3.Left=0 : Window3.Top=0 : Window3.Width=800 : Window3.Height=600
Window3.Caption="  Options  Window" : Window3.BorderStyle=bsNone
Window3.WindowState=wsNormal : Window3.FormStyle=fsStayOnTop
Window3.Color=&HB8CCD8 : Window3.OnKeyDown=Key3Down

Canvas3.Parent=Window3 :  Canvas3.Font=Font2 : Canvas3.Left=0
Canvas3.Top=0 : Canvas3.Width=800 : Canvas3.Height=600
Canvas3.Color=&HB8CCD8 : Canvas3.OnPaint=Canvas3Redraw
Canvas3.OnMouseDown=Mouse3Down

FOR Z=0 TO 41 : DTitles(Z)=SPACE$(29) : FTitles(Z)=SPACE$(29) : NEXT

YY=15 : FOR Z=0 TO 10
WCats(Z).Parent=Window3 : WCats(Z).Font=Font5 : WCats(Z).Color=&HA8CCE0
WCats(Z).Angle=0 : WCats(Z).Left=25 : WCats(Z).Top=YY : WCats(Z).Cursor=crDefault
WCats(Z+11).Parent=Window3 : WCats(Z+11).Font=Font5 : WCats(Z+11).Color=&HA8CCE0
WCats(Z+11).Angle=0 : WCats(Z+11).Left=422 : WCats(Z+11).Top=YY : WCats(Z+11).Cursor=crDefault
INC (YY,40) : NEXT

Window4.Left=6 : Window4.Top=50 : Window4.Width=781 : Window4.Height=316
Window4.BorderStyle=bsNone : Window4.WindowState=wsNormal : Window4.Color=&H98BCD0
Window4.FormStyle=fsStayOnTop : Window4.OnKeyDown=Key4Down

Canvas4.Parent=Window4 :  Canvas4.Font=Font2 : Canvas4.Left=0
Canvas4.Top=0 : Canvas4.Width=782 : Canvas4.Height=316
Canvas4.OnMouseDown=Mouse4Down : Canvas4.OnPaint=Canvas4Redraw

Label15.Parent=Window4 : Label15.Font=Font8 :  Label15.Angle=0
Label15.Left=220 : Label15.Top=22 : Label15.Caption="Search"
Label15.Color=&H30A0E0 : Label15.Cursor=crDefault

Label16.Parent=Window4 : Label16.Font=Font8 :  Label16.Angle=0
Label16.Left=338 : Label16.Top=72 : Label16.Caption=""
Label16.Color=&H60B0E0 : Label16.Cursor=crDefault

Edit8.Parent=Window4 : Edit8.Font=Font7 : Edit8.CharCase=ecNormal
Edit8.Left=344 : Edit8.Top=25 : Edit8.Width=320 : Edit8.Height=23
Edit8.MaxLength=42 : Edit8.BorderStyle=bsNone : Edit8.Color=&H504030
Edit8.Hint=" Enter 1 or Characters (or Words) "
Edit8.Text="" : Edit8.ShowHint=True : Edit8.OnKeyUp=Key4Down

Window5.Left=6 : Window5.Top=46 : Window5.Width=781 : Window5.Height=366
Window5.BorderStyle=bsNone : Window5.WindowState=wsNormal : Window5.Color=&H98BCD0
Window5.FormStyle=fsStayOnTop : Window5.OnKeyDown=Key5Down

Canvas5.Parent=Window5 :  Canvas5.Font=Font2 : Canvas5.Left=0
Canvas5.Top=0 : Canvas5.Width=782 : Canvas5.Height=366 : Canvas5.Color=&H000000
Canvas5.OnMouseDown=Mouse5Down : Canvas5.OnPaint=Canvas5Redraw

Label9.Parent=Window5 : Label9.Font=Font6 : Label9.Angle=0
Label9.Left=24 : Label9.Top=16 : Label9.Caption="D/F Lines"
Label9.Color=&HB09070 : Label9.Cursor=crDefault

Label10.Parent=Window5 : Label10.Font=Font6 : Label10.Angle=0
Label10.Left=18 : Label10.Top=66 : Label10.Caption="Automatic"
Label10.Color=&HB09070 : Label10.Cursor=crDefault

Label11.Parent=Window5 : Label11.Font=Font6 : Label11.Angle=0
Label11.Left=45 : Label11.Top=116 : Label11.Caption="Spelling"
Label11.Color=&HB09070 : Label11.Cursor=crDefault

Label12.Parent=Window5 : Label12.Font=Font6 : Label12.Angle=0
Label12.Left=13 : Label12.Top=166 : Label12.Caption="Word Split"
Label12.Color=&HB09070 : Label12.Cursor=crDefault

Label13.Parent=Window5 : Label13.Font=Font6 : Label13.Angle=0
Label13.Left=60 : Label13.Top=216 : Label13.Caption="Reveal"
Label13.Color=&HB09070 : Label13.Cursor=crDefault

Label14.Parent=Window5 : Label14.Font=Font6 : Label14.Angle=0
Label14.Left=69 : Label14.Top=266 : Label14.Caption="Pause"
Label14.Color=&HB09070 : Label14.Cursor=crDefault

Label17.Parent=Window5 : Label17.Font=Font6 : Label17.Angle=0
Label17.Left=22 : Label17.Top=316 : Label17.Caption="NAV Lines"
Label17.Color=&HB09070 : Label17.Cursor=crDefault

Edit1.Parent=Window5 : Edit1.Font=Font7 : Edit1.CharCase=ecNormal
Edit1.Left=166 : Edit1.Top=21 : Edit1.Width=36 : Edit1.Height=23
Edit1.MaxLength=1 : Edit1.BorderStyle=bsNone : Edit1.Color=&H504030
Edit1.Hint=" Default/Foreign Lines  -  Delay  (In Seconds) "
Edit1.InputMask="#" : Edit1.EditText="0"
Edit1.ShowHint=True : Edit1.OnKeyDown=Key5Down

Edit2.Parent=Window5 : Edit2.Font=Font7 : Edit2.CharCase=ecNormal
Edit2.Left=166 : Edit2.Top=71 : Edit2.Width=36 : Edit2.Height=23
Edit2.MaxLength=1 : Edit2.BorderStyle=bsNone : Edit2.Color=&H504030
Edit2.Hint=" Automatic Mode  -  Delay  (In Seconds) "
Edit2.InputMask="#" : Edit2.EditText="0"
Edit2.ShowHint=True : Edit2.OnKeyDown=Key5Down

Edit3.Parent=Window5 : Edit3.Font=Font7 : Edit3.CharCase=ecNormal
Edit3.Left=166 : Edit3.Top=121 : Edit3.Width=36 : Edit3.Height=23
Edit3.MaxLength=1 : Edit3.BorderStyle=bsNone : Edit3.Color=&H504030
Edit3.Hint=" Spelling  -  Delay  (In Seconds) "
Edit3.InputMask="#" : Edit3.EditText="0"
Edit3.ShowHint=True : Edit3.OnKeyDown=Key5Down

Edit4.Parent=Window5 : Edit4.Font=Font7 : Edit4.CharCase=ecNormal
Edit4.Left=166 : Edit4.Top=171 : Edit4.Width=36 : Edit4.Height=23
Edit4.MaxLength=1 : Edit4.BorderStyle=bsNone : Edit4.Color=&H504030
Edit4.Hint=" Word Split  -  Delay  (In Seconds) "
Edit4.InputMask="#" : Edit4.EditText="0"
Edit4.ShowHint=True : Edit4.OnKeyDown=Key5Down

Edit5.Parent=Window5 : Edit5.Font=Font7 : Edit5.CharCase=ecNormal
Edit5.Left=166 : Edit5.Top=221 : Edit5.Width=36 : Edit5.Height=23
Edit5.MaxLength=1 : Edit5.BorderStyle=bsNone : Edit5.Color=&H504030
Edit5.Hint=" Reveal Next Item  -  Delay  (In Seconds) "
Edit5.InputMask="#" : Edit5.EditText="0"
Edit5.ShowHint=True : Edit5.OnKeyDown=Key5Down

Edit6.Parent=Window5 : Edit6.Font=Font7 : Edit6.CharCase=ecNormal
Edit6.Left=166 : Edit6.Top=271 : Edit6.Width=36 : Edit6.Height=23
Edit6.MaxLength=1 : Edit6.BorderStyle=bsNone : Edit6.Color=&H504030
Edit6.Hint=" Pause LGUI  -  Delay  (In Seconds) "
Edit6.InputMask="#" : Edit6.EditText="0"
Edit6.ShowHint=True : Edit6.OnKeyDown=Key5Down

Edit7.Parent=Window5 : Edit7.Font=Font7 : Edit7.CharCase=ecNormal
Edit7.Left=166 : Edit7.Top=321 : Edit7.Width=36 : Edit7.Height=23
Edit7.MaxLength=1 : Edit7.BorderStyle=bsNone : Edit7.Color=&H504030
Edit7.Hint=" Noun Adjective Verb Lines  -  Delay  (In Seconds) "
Edit7.InputMask="#" : Edit7.EditText="0"
Edit7.ShowHint=True : Edit7.OnKeyDown=Key5Down

'Save_Settings
'Application.Terminate

RANDOMIZE(-1) : Load_Settings : Load_Titles(0) : Load_Titles(1)
Get_Drives : FOR YY=2 TO 9 : Load_Files(YY) : NEXT : DT_Check
MISCSTART=ALen(21) : MISCEND=ALen(65) : MISCTOT=CLen(21) : MISCLEN=CLen(65)
IF SPEECH=1 THEN
Load_FNSpeech : Load_FSSpeech
END IF
AutoTimer.Interval=3000 : AutoTimer.Enabled=1 : AutoTimer.OnTimer=Auto_Timer
Window1.ShowModal
